Midterm Exam (Ch1-14)

  1. Bash is:

    • a networking term
    • a shell
    • an operating system
    • a website
  2. The two login types are:

    • URI and CLU
    • CLI and GUI
    • GUX and CLI
    • URI and CLI
  3. A software release cycle describes:

    • How often the computer must be upgraded to support new software
    • How often the computer must be rebooted
    • How often upgrades come out to software
    • The often security fixes are implemented
    • How often the software’s memory is released back to the operating system
  4. Which Linux distributions are derived from Red Hat?

    (choose two)

    • CentOS
    • Slackware
    • Ubuntu
    • Debian
    • Fedora
  5. Bundling utilities, management tools, and application software with a Linux kernel is called a:

    • A trademark
    • A text editor
    • A type of hardware
    • A distribution of Linux
  6. To display your current location within the filesystem, you can type:

    • cwd
    • pwd
    • dir
    • whereami
  7. A command can take the form of:

    (choose three)

    • A configuration file
    • A block
    • A program built-in to the shell
    • An alias
    • A function
    • A variable
  8. You want to execute the ls command with two options: -r and -l. Which of the following are valid ways to run this command:

    (choose three)

    • ls -r -l
    • ls rl
    • rl ls
    • ls -l -r
    • ls --r --l
    • ls -rl
  9. You can pass arguments to long options by using which of the following techniques:

    (choose two)

    • –option~argument
    • –option argument
    • –option=argument 
    • –option{argument}
  10. When typing a command, you can have the bash shell complete the command by pressing which key?

    • The Enter key
    • The Del key
    • The Backspace key
    • The Tab key
    • The Up Arrow key
  11. Long command options are preceded by which two characters?

    • **
    • --
    • ||
    • &&
  12. Which command is used in order to view the manual page for a topic?

    • -m
    • -x
    • show
    • doc
    • man
  13. The ______ command will display your current working directory.

    • exit
    • uname
    • pwd
    • exec
  14. To see a list of commands that are available while viewing a man page, you can type the __ character.

    • c
    • g
    • w
    • h
  15. Environment variables are:

    • Not used by shells at all
    • Are not a valid type of variable
    • Only available to the shell they are created in
    • Passed into other shells and commands
  16. If you want to delete a variable, you can run:

    • wipe
    • unset
    • clear
    • delete
  17. Local variables are:

    • Not used by shells at all
    • Are not a valid type of variable
    • Passed into other shells and commands
    • Only available to the shell they are created in
  18. ion ID 2336

    • Shell variables are used to:
    • Hold critical system information
    • Hide passwords
    • Prevent users from logging in
    • Reboot the system
  19. The /bin directory contains:

    • Nothing; it is not a valid directory
    • Essential administrative commands
    • The most fundamental commands that are essential for the operating system to function
    • Commands that have been compiled from local sources
  20. The /sbin directory contains:

    • Nothing; it is not a valid directory
    • Commands that have been compiled from local sources
    • Essential administrative commands
    • The most fundamental commands that are essential
  21. To view all current variables, you can use:

    • var
    • view
    • dump
    • set
  22. Which file can you place in your home directory to be executed when you log off the system?

    • /etc/bashrc
    • ~/.bash_profile
    • ~/.bash_logout
    • ~/.bashrc
  23. Which of the following files is for all bash shell users and executed every time a bash shell is opened?

    • ~/.bashrc
    • /etc/bashrc
    • /etc/profile
    • ~/.bash_profile
  24. Which of the following files is for all bash shell users and executed only at login?

    • /etc/bashrc
    • /etc/profile
    • ~/.bashrc
    • ~/.bash_profile
  25. Which of the following will create a variable?

    • variable~value
    • variable value
    • variable=value
    • variable+value
  26. Which of the following is not used for globbing?

    • *
    • ?
    • #
    • [ ]
  27. Which command will display more information about globbing?

    • man globbing
    • man 7 globbing
    • man 7 glob
    • man -7 glob
  28. The glob pattern [a-d] would match:

    • All files
    • A file name with a single character that is either an a, -, or d.
    • A file name with a single character that is either a a, b, c, or d.
    • Nothing, this is an invalid glob pattern.
  29. Use the ___ option to display hidden files with the ls command.

    • -h
    • -a
    • -D
  30. The ls command can list the contents of only one directory at a time.

    True or False?

    • True
    • False
  31. The period . character in the output of the ls command represents:

    • Hidden files
    • The end of the command output
    • The current directory
    • Directories that can’t be accessed
  32. To perform a long listing to show file details, use which of the following commands:

    • ls -l
    • ll
    • ls -L
    • ls -D
  33. To copy the contents of a directory, use the following option(s) for the cp command:

    (choose two)

    • -r
    • -A
    • -R
    • -d
  34. The mv command can be used to move more than one file at a time.

    True or False?

    • True
    • False
  35. The mv command will rename a file when a new directory is not specified.

    True or False?

    • True
    • False
  36. The rmdir command can be used to delete directories and their contents.

    True or False?

    • True
    • False
  37. Which character at the beginning of a long listing indicates a directory?

    • d
    • c
    • l
  38. Which of the following are advantages of using the find command?

    (choose two)

    • It is quicker than the locate command
    • Its results are always the most up-to-date
    • It pages the results
    • It can search by file attribute types
  39. The FHS sets which standard?

    • Which filesystem types should be used
    • Which partitions should be created
    • Which directories should be used to hold specific files
    • Which services should be installed
  40. What directory is used as a temporary mount point?

    • /tmpmnt
    • /xbin
    • /mnt
    • /etc
  41. Which option to the find command will search by user owner?

    • -uowner
    • -owner
    • -user
    • -person
  42. Which directory represents the root of the filesystem hierarchy?

    • /etc
    • /var
    • /
    • /root
  43. Which directory is used to store user home directories?

    • /home
    • /usr
    • /homedir
    • /tmp
  44. Which directory is used for the home directory of the root user?

    • /
    • /root
    • /var
    • /home
  45. If you want to see the entire contents of a text file, you can use the _____ command:

    • type
    • cat
    • wc
    • cut
  46. The head -n -1 readme.txt command will:

    • Display all but the first line of readme.txt
    • Number the first line of readme.txt
    • Display the first line of readme.txt
    • Display all but the last line of readme.txt
  47. Which command will merge two files together line by line?

    • join
    • merge
    • combo
    • paste
  48. If you want to break apart a large file into smaller files, you can use:

    • dump
    • split
    • cat
    • break
  49. If you want a file to be displayed with its lines numbered, you can use:

    • nc
    • nl
    • fmt
    • cut
  50. Which of the following commands can be used to scroll through a text file?

    • head
    • sed
    • less
    • cat
  51. The regular expression a* is equivalent to:

    • a{0,}
    • a{1}
    • a{0,1}
    • a{1,}
  52. To use extended regular expressions, you can use:

    (choose two)

    • grep -e
    • egrep
    • grep -E
    • fgrep
  53. What does the vertical bar | character do in a regular expression?

    • Redirects input to the command
    • Redirects output from the command
    • Separates alternative patterns that can be matches
    • Separates repetition modifiers
  54. What is not a purpose of using parentheses around parts of a regular expression?

    • They can be used to make alternation more efficient
    • They can be used to refer back to what was matched
    • They can be used to change the order that the pattern is evaluating
    • They can be used to group characters for repetition
  55. Which of the following regular expression characters is an extended regular expression character?

    • .
    • +
    • $
    • *
  56. Which regular expression character matches any one character?

    • +
    • *
    • .
    • ?
  57. If you are in the vi command mode and want to begin inserting text before your cursor, you can type:

    • O
    • i
    • A
    • o
  58. If you are in vi command mode and want to add a new line after your cursor, you can type:

    • O
    • i
    • o
    • a
  59. If you want to move a character to the right in vi command mode, you can press the Right Arrow Key → or:

    • k
    • l
    • j
    • h
  60. To go to the first line of a vi document in command mode, you can type:

    (choose two)

    • 1G
    • G
    • gg
    • GG
  61. To perform cut and paste in a vi document, you actually do:

    • delete and put
    • yank and put
    • delete and yank
    • yank and paste
  62. To save and then quit, you can type in command mode:

    • WW
    • ZZ
    • QQ
    • !!
  63. If you want to append content to a file with the normal output of a command, you can use:

    • 1>
    • >
    • >>
    • 2>>
  64. This stream is the output of a command operating normally:

    • stdout
    • stdin
    • stdnorm
    • stderr
  65. Two or more commands combined with the vertical bar | character between them form a:

    • pipeline
    • streamline
    • outputline
    • command line
  66. Which command can be used to send the output of a command to both stdout and a file:

    • ls | tee /tmp/output.txt
    • ls 2 | /tmp/output
    • ls | echo /tmp/output.txt
    • ls | /tmp/output.txt
  67. A popular program for monitoring running processes in real-time is:

    • top
    • ghost
    • mon
    • watcher
  68. The uptime command prints a statistic representing the system load over what three time spans?

    (choose three)

    • Last ten minutes
    • Last five minutes
    • Last minute
    • Last fifteen minutes
    • Last hour
    • Last thirty minutes
  69. The _____ command will list the commands that are running in your terminal.

    • proc
    • ps
    • ls
    • list
  70. The key press combination that will request a process to stop is:

    • CTRL+C
    • CTRL+P
    • CTRL+Z
    • CTRL+D
  71. To change the niceness value of an existing process, you can use the _____ command.

    • renice
    • reset
    • set
    • nice
  72. To execute a command with the default priority, which value do you pass to the nice command?

    • 19
    • 20
    • -20
    • 0
  73. To see how long the system has been running, you can use the _____ command.

    • nice
    • free
    • uptime
    • ps
  74. To see the list of background processes that you have started in your shell, you can run:

    • process
    • jobs
    • list
    • work
  75. To send a signal to a set of processes with the same name, you can run:

    • sigkill
    • allkill
    • grpkill
    • killall
  76. To view statistics on memory availability, you can use:

    • free
    • mem
    • stat
    • uname
  77. Using the kill command always terminates processes.

    True or False?

    • True
    • False
  78. By default, tar will attempt to extract an archive…

    • to the specified directory.
    • into the archive’s parent directory.
    • into the working directory.
    • into the user’s home directory.
  79. The dd command can be used to copy entire partitions.

    • False
    • True
  80. To decompress the archive example.gz, use the following command:

    • gzip -u example.gz
    • gunzip -x example.gz
    • gzip -x example.gz
    • gunzip example.gz
  81. Which of the following commands could be used to extract the archive, example.tar?

    • tar -uz example.tar
    • tar -uf example.tar
    • tar -xf example.tar
    • tar -xz example.tar
  82. Which option to the zip command will list its files without uncompressing them?

    • -l
    • -d
    • -R
    • -r
  83. For the rwxr-x--x permission set, the highlighted permissions belong to:

    • The user owner of the file
    • All users besides the user owner and group owner
    • The user owner and group owner of the file
    • The group owner of the file
  84. The command, chmod u=g will:

    • Set the user owners permissions to match the group owners permission
    • Set the group owners permissions to match the user owners permissions
    • Set the user owners permissions to rwx
    • Nothing, the command syntax is invalid
  85. The group ownership of a file may only be changed by:

    • Any user can change the group ownership of any file
    • The root user
    • The owner of the file
    • Both the root user and the owner of the file
  86. The only person who can change the user ownership of a file is:

    • The root user
    • Any user can change the group ownership of any file
    • The owner of the file
    • Both the root user and owner of the file
  87. The setuid permission on a file:

    • Causes the file to run under the owner’s identity
    • Causes the file to never run as root
    • Causes the file to run under the user’s identity
    • Causes the file to always run as root
  88. To run a script file, you need both read and execute permission.

    True or False?

    • True
    • False
  89. Which command can be used to set what your default permissions will be on new files?

    • mode
    • umode
    • umask
    • mask
  90. Which command can change the user owner of a file?

    • own
    • chown
    • pawn
    • chpawn
  91. Which command is used to change permissions on a file?

    • chmod
    • chperm
    • chgperm
    • chgmode
  92. Which commands can be used to change the ownership of a file?

    (choose two)

    • chown
    • chgrp
    • chggrp
    • newgrp
  93. Which command will allow you to change the group ownership of a file that you own?

    • chgrp
    • regroup
    • chmod
    • chown
  94. Which permission, when set on a directory, causes new files and directories that are created inside to be owned by the group that owns the directory?

    • write
    • setgid
    • setuid
    • sticky bit
  95. What permissions are typically placed on soft link files?

    • rw-rw-rw-
    • ---------
    • rwxrwxrwx
    • rwx------
  96. Which are valid link types in Linux?

    (choose two)

    • Stable links
    • Hard links
    • Filesystem links
    • Soft links
  97. Which type of link can be made to directories, hard or soft?

    • soft
    • hard
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments