Chapter 10 exam Flashcards
Error messages generated by commands are sent where by default?
STDERR
STDIN
Log files
STDOUT
STDERR
A successful command may, or may not print output to STDOUT.
True or False?
True
False
True
Which of the following commands will direct error messages to the file, error.log?
ls /root»_space; error.log
ls /root > error.log
ls /root 2> error.log
ls /root $> error.log
ls /root 2> error.log
A pipe allows you to…
…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.
…send the output of one command to another.
Channel 2 is:
STDOUT
STDALL
STDERR
STDIN
STDERR
Which of the following commands will append its output to output.file?
echo Testing»_space; output.file
echo Testing > output.file
output.file < echo Testing
echo Testing -> output.file
echo Testing»_space; output.file
Which command(s) can be used to sort the lines of list.file alphabetically and display it on the screen? (choose two)
sort < list.file
cat list.file»_space; sort
echo list.file > sort
cat list.file | sort
sort < list.file
cat list.file | sort
Which option of the head command will display only the first five lines of a file?
No option needed; head displays only five lines by default.
- n
- l 5
- n 5
-n 5
The grep command…
…will display all the lines that begin with the specified Regular Expression.
…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.
…is not case sensitive.
…will display all the lines in a file containing the specified Regular Expression.
The grep command can be used with glob characters.
True or False?
True
False
True
Which of the following commands will display only lines that begin with start?
grep \start file.txt
grep $start file.txt
grep *start file.txt
grep ^start file.txt
grep ^start file.txt
Which of the following commands will display only lines that begin with test?
grep $test* file.txt
grep *test file.txt
grep &test file.txt
grep ^test file.txt
grep ^test file.txt
Which of the following commands will display lines that contain either start or end?
egrep ‘start|end’ file.txt
egrep (start|end) file.txt
egrep start end file.txt
egrep start&end file.txt
egrep ‘start|end’ file.txt
Which of the following commands can be used to scroll through a text file?
(choose two)
some
more
cat
less
more
less
Which option for the cut command is used to specify a delimiter?
-D
-f
=
-d
-d