Linux Essentials Chapter 8 Exam

Linux Essentials Chapter 8 Exam Answer

  1. Question ID 93

    Error messages generated by commands are sent where by default?

    • Log files
    • STDOUT
    • STDERR
    • STDIN
  2. Question ID 94

    A successful command will print output to STDOUT.

    True or False?

    • True
    • False
  3. Question ID 95

    Which of the following commands will direct error messages to the file, error.log?

    (choose one)

    • ls /root >> error.log
    • ls /root 2> error.log
    • ls /root $> error.log
    • ls /root > error.log
  4. Question ID 96

    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.
  5. Question ID 97

    Channel 2 is:

    • STDIN
    • STDALL
    • STDOUT
    • STDERR
  6. Question ID 98

    Which of the following commands will append its output to output.file?

    • echo Testing > output.file
    • echo Testing >> output.file
    • output.file < echo Testing
    • echo Testing -> output.file
  7. Question ID 99

    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 | sort
    • cat list.file >> sort
    • echo list.file > sort
  8. Question ID 100

    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
    • -n 5
  9. Question ID 101

    The grep command…

    • …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.
  10. Question ID 102

    The grep command can be used with glob characters.

    True or False?

    • True
    • False
  11. Question ID 103

    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. Question ID 104

    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. Question ID 105

    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. Question ID 106

    Which of the following commands can be used to scroll through a text file?

    (choose two)

    • some
    • less
    • cat
    • more
  15. Question ID 107

    The find command can search for files based on the size of the file.

    True or False?

    • True
    • False
  16. Question ID 108

    Which of the following commands scans the file to determine file locations?

    • search
    • locate
    • where
    • find
  17. Question ID 109

    Which option for the cut command is used to specify a delimiter?

    • -f
    • -d
    • =
    • -D
  18. Question ID 110

    Which option for the cut command is used to specify the field?

    • -D
    • -f
    • -d
    • #
  19. Question ID 111

    Which option for the wc command will print the number of lines in a file?

    • -l
    • -w
    • -C
    • -L
  20. Question ID 112

    Which option for the wc command will print the total number of words in a file?

    • -l
    • -L
    • -C
    • -w
  21. Question ID 113

    Which command can be used to print line numbers?

    • num
    • sort
    • ln
    • nl
  22. Question ID 114

    The command echo “text” > file.txt will create file.txt if it does not already exist.

    True or False?

    • True
    • False
  23. Question ID 115

    The command echo “text” > file.txt will not overwrite file.txt if it already exists.

    True or False?

    • True
    • False
  24. Question ID 116

    The command echo “text” >> file.txt will not overwrite file.txt if it already exists.

    True or False?

    • True
    • False

Comments

comments