Working with Text M10 Exam

  1. Error messages generated by commands are sent where by default?

    • STDERR
    • STDIN
    • STDOUT
    • Log files
  2. A successful command may, or may not print output to STDOUT. True or False?

    • True
    • False
  3. Which of the following commands will direct error messages to the file, error.log?

    • ls /root > error.log
    • ls /root >> error.log
    • ls /root $> error.log
    • ls /root 2> error.log
  4. A pipe allows you to…

    • …send the output of a command to a file.
    • …type multiple commands at one prompt.
    • …send the same input to multiple commands.
    • …send the output of one command to another.
  5. Channel 2 is

    • STDIN
    • STDALL
    • STDOUT
    • STDERR
  6. Which of the following commands will append its output to output.file?

    • echo Testing > output.file
    • echo Testing >> output.file
    • echo Testing -> output.file
    • output.file < echo Testing
  7. Which command(s) can be used to sort the lines of list.file alphabetically and display it on the screen?(choose two)

    • cat list.file | sort
    • echo list.file > sort
    • cat list.file >> sort
    • sort < list.file
  8. Which option of the head command will display only the first five lines of a file?

    • -l 5
    • No option needed; head displays only five lines by default.
    • -n 5
    • -n
  9. 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.
    • …is not case sensitive.
    • …will display the line numbers in a file that contain a specified Regular Expression.
  10. The grep command can be used with glob characters.True or False?

    • True
    • False
  11. 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
  12. 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
  13. 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
  14. Which of the following commands can be used to scroll through a text file? (choose two)

    • some
    • more
    • less
    • cat
  15. Which option for the cut command is used to specify a delimiter?

    • =
    • -D
    • -f
    • -d
  16. Which option for the cut command is used to specify the field?

    • -d
    • -D
    • -f
    • #
  17. Which option for the wc command will print the number of lines in a file?

    • -L
    • -w
    • -C
    • -l
  18. Which option for the wc command will print the total number of words in a file?

    • -l
    • -C
    • -w
    • -L
  19. Which command can be used to print line numbers?

    • nl
    • ln
    • num
    • sort
  20. The command echo "text" > file.txt will create file.txt if it does not already exist. True or False?

    • True
    • False
  21. The command echo "text" > file.txt will not overwrite file.txt if it already exists. True or False?

    • True
    • False
  22. The command echo "text" >> file.txt will not overwrite file.txt if it already exists. True or False?

    • True
    • False
Subscribe
Notify of
guest
0 Comments
Newest
Oldest Most Voted
Inline Feedbacks
View all comments