ITN 170: Linux System Administration - Ch. 3

  1. The less command offers less functionality than the more command.
    False

    [The less command offers greater functionality compared to the more command, including the ability to scroll contents using cursor keys.]
  2. A user typed the command pwd and saw the output: /home/jim/sales/pending. How could that user navigate to the /home/jim directory?




    B.  cd ../..

    [Since the /home/jim directory is two parent directories closer to the root directory compared to /home/jim/sales/pending, you can specify a relative path of two parent directories (../..) as an argument to the cd command.]
  3. Linux has only one root directory per directory tree.
    True

    [UNIX and Linux systems have a single root directory, regardless of the number of storage devices within the system.]
  4. If a user's current directory is /home/mary/project1, which command could they use to move to the etc directory directly under the root?




    C.  cd /etc

    [The /etc path refers to the etc directory directly under the root. The relative path of .. would switch to /home/mary, while the relative path of etc would switch to /home/mary/project1/etc.]
  5. A user types the command head /poems/mary. What will be displayed on the terminal screen?




    A. the first 10 lines of the file mary

    [The head command displays the first 10 lines of a text file by default.]
  6. After typing the ls –a command, you notice a file whose filename begins with a period (.). What does this mean?




    C. It is a hidden file.

    [Hidden files have a filename that begin with a period character.]
  7. The vi editor can function in which two of the following modes? (Choose both that apply.)




    • C. command
    • d. insert

    [The two modes available within the vi editor are command mode and insert mode.]
  8. How can a user switch from insert mode to command mode when using the vi editor?




    C. Press the Esc key.

    [You can press the Escape (Esc) key to switch from insert mode to command mode within the vi editor.]
  9. Using a regular expression, how can you indicate a character that is not an a or b or c or d?




    C.  [^abcd]

    [The square bracket regular expression metacharacters indicate a single character specified within, and the ^ regular expression metacharacter used within square brackets reverses the pattern matching.]
  10. A special device file is used to _____.




    C. represent hardware devices

    [Device files are special files that represent hardware devices on the system, such as hard disk drives.]
  11. A directory is a type of file.a. Trueb. False
    True

    [Directories are special files that serve to group other files.]
  12. What will typing q! at the : prompt in command mode do when using the vi editor?




    A. quit without saving any changes

    [The q! sequence instructs the vi editor to quit and discard any changes made.]
  13. If "resume" is the name of a file in the home directory off the root of the filesystem and your present working directory is home, what is the relative name for the file named resume?




    C. resume

    [Since your working directory is /home, you can refer to the file called resume within the same directory by its name alone.]
  14. The tac command _____.




    A. displays the contents of a file in reverse order, last line first and first line last

    [The tac command performs the reverse of the cat command; it displays a file in reverse line order.]
  15. Which of the following is an absolute pathname? (Choose all that apply.)




    • D. C:\myfolder\resume
    • c. /home/resume

    [On a Windows system, absolute pathnames start from the root directory of a drive letter (e.g., C:\). On a Linux system, absolute pathnames start from the single root directory on the system (/).]
  16. What will the following wildcard expression return: file[a-c]?




    C.  filea, fileb, filec

    [The square bracket metacharacters are used to refer to a single character, matching the contents within.]
  17. After typing the ls –F command, you notice a filename that ends with an * (asterisk) character. What does this mean?




    D. It is an executable file.

    [The ls -F command appends an asterisk to executable files.]
  18. Which command searches for and displays any text contents of a binary file?




    A.  strings

    [The strings command displays the text contents of any file type.]
  19. Which command would a user type on the command line to find out the current directory in the directory tree?




    D.  pwd

    [The pwd command displays the working directory of the user in the directory tree.]
  20. How can you specify a text pattern that must be at the beginning of a line of text using a regular expression?




    C. Precede the string with a ^.

    [The ^ regular expression specifies that the pattern to match must appear at the beginning of a line.]
Author
S.H.
ID
363693
Card Set
ITN 170: Linux System Administration - Ch. 3
Description
Updated