Question 1
Question
Error messages generated by commands are sent where by default?
Answer
-
Log files
-
STDOUT
-
STDERR
-
STDIN
Question 2
Question
A successful command will print output to STDOUT.
Question 3
Question
Which of the following commands will direct error messages to the file, error.log?
Answer
-
ls /root >> error.log
-
ls /root 2> error.log
-
ls /root $> error.log
-
ls /root > error.log
Question 4
Question
A pipe allows you to…
Answer
-
…send the same input to multiple commands.
-
…type multiple commands at one prompt.
-
…send the output of one command to another.
-
…send the output of a command to a file.
Question 5
Answer
-
STDIN
-
STDALL
-
STDOUT
-
STDERR
Question 6
Question
Which of the following commands will append its output to output.file?
Answer
-
echo Testing > output.file
-
echo Testing >> output.file
-
output.file < echo Testing
-
echo Testing -> output.file
Question 7
Question
Which command(s) can be used to sort the lines of list.file alphabetically and display it on the screen?
Answer
-
sort < list.file
-
cat list.file | sort
-
cat list.file >> sort
-
echo list.file > sort
Question 8
Question
Which option of the head command will display only the first five lines of a file?
Question 9
Question
The grep command…
Answer
-
…will display all the lines that begin with the specified Regular Expression.
-
…is not case sensitive.
-
…will display all the lines in a file containing the specified Regular Expression.
-
…will display the line numbers in a file that contain a specified Regular Expression.
Question 10
Question
The grep command can be used with glob characters.
Question 11
Question
Which of the following commands will display only lines that begin with start?
Answer
-
grep *start file.txt
-
grep $start file.txt
-
grep start file.txt
-
grep ^start file.txt
Question 12
Question
Which of the following commands will display only lines that begin with test?
Answer
-
grep ^test file.txt
-
grep $test* file.txt
-
grep *test file.txt
-
grep &test file.txt
Question 13
Question
Which of the following commands will display lines that contain either start or end?
Question 14
Question
Which of the following commands can be used to scroll through a text file?
Question 15
Question
The find command can search for files based on the size of the file.
Question 16
Question
Which of the following commands scans the file to determine file locations?
Question 17
Question
Which option for the cut command is used to specify a delimiter?
Question 18
Question
Which option for the cut command is used to specify the field?
Question 19
Question
Which option for the wc command will print the number of lines in a file?
Question 20
Question
Which option for the wc command will print the total number of words in a file?
Question 21
Question
Which command can be used to print line numbers?
Question 22
Question
The command echo “text” > file.txt will create file.txt if it does not already exist.
Question 23
Question
The command echo “text” > file.txt will not overwrite file.txt if it already exists.
Question 24
Question
The command echo “text” >> file.txt will not overwrite file.txt if it already exists.