CMIT 291 - LINUX Final Exam
CMIT 291 - LINUX Final Exam
9. You need to locate files within the /tmp directory or one of its
subdirectories. These files should be empty. Assuming you have
super user privileges, which command should you use?
a. find/tmp-empty
Page 1 of 20
CMIT 291 - LINUX
10. Which command can be used to search contents of all files below
your current location for files that contain the characters DB?
a. grep-r”DB”*
11. Which protocol does a mail server use to send email messages to
remote mail servers?
a. SMTP (simple mail transfer protocol)
14. Working with a file called test.php to determine line count, the
output from the wc command is 14 18 293 test.php. Which of the 3
digits corresponds to line count?
a. 14
15. Which option is used to change the number of lines of output for
the head and tail commands?
a. -n
16. You need to set a watch on the /var/log/secure file. Using super
user privileges, which command should you employ?
a. tail -f/var/log/secure
17. When performing rsync across devices, you receive errors that file
ownership cannot be preserved, likely due to missing users or groups
on the destination system. Which option should be removed from the
rsync options in order to not preserve user and group ownership?
a. -o
Page 2 of 20
CMIT 291 - LINUX
b. -g
18. Which TCP port needs to be allowed through the firewall for
standard LDAP traffic to be received by the server?
a. 389
20. Assuming you own and operate the domain example.com, the
valid hosts are shown as *.example.com. What does this tell you
about this certificate?
a. It is a wildcard certificate
22. Which option for the wc command prints the number of lines given
as input?
a. -l
Page 3 of 20
CMIT 291 - LINUX
25. Which command is used to query and work with the hardware
clock on the system?
a. Hwclock
32. You are troubleshooting a service that does not stop correctly.
During troubleshooting, you find that the command to stop the service
needs to be changed. Which configuration option specifies the
command to execute for stopping a service?
a. ExecStop
Page 4 of 20
CMIT 291 - LINUX
34. Which command can be used to list all of the detected hardware
within a system?
a. Lshw
Page 5 of 20
CMIT 291 - LINUX
43. You have added a new RAID adapter to the system. Which
command can be used to ensure that the adapter was detected by
the kernel?
a. dmesg
45. Which option of the systemctl command shows the current target
to which the system will boot?
a. get-default
46. Which test within a shell script while loop will examine one value to
see if it is less than another?
a. -lt
47. You would like to efficiently manage firewall rules such that you
can define a group of IP addresses to which a single rule can be
applied. Which command enables you to create a group of IP
addresses?
a. ipset
Page 6 of 20
CMIT 291 - LINUX
52. Which option to lspci is used to display both numeric codes and
device names?
a. -nn
53. Which runlevel is typically used for single user mode, as indicated
in /etc/inittab?
a. 1
55. Which command can be used to view the kernel ring buffer in
order to troubleshoot the boot process?
a. Dmesg
Page 7 of 20
CMIT 291 - LINUX
a. log
59. Which of the following commands saves the current set of iptables
rules into a file?
a. Iptables-save
Page 8 of 20
CMIT 291 - LINUX
66. You are writing a shell script using Bash and need to print the
contents of the variable. Which of the following commands can be
used to do so?
a. echo
67. You are using a container image for cloud deployment and are
building a stateful application that must store data between
deployments. Which type of storage should be used?
a. Persistent volume
68. Which configuration option within a systemd timer unit the files
causes the program to execute a certain number of seconds or
minutes after the system has booted?
a. OnBootSec
69. Which file test within a Bash script checks to see if the file exists?
a. -f
72. On which port does the slapd LDAP daemon listen for
connections?
a. 389
74. Within which directory will you find the repositories used by yum?
a. /etc/yum.repos.d
Page 9 of 20
CMIT 291 - LINUX
77. During the boot of a system with GRUB, which key can be pressed
to display the GRUB menu?
a. Shift
78. Which of the following is the correct method for invoking the Bash
shell for a script, typically found as the first line of the server?
a. #!/bin/bash
79. The SAMN has crashed again, and one of the filesystems in a
Linux server has become significantly corrupt as a result. Which
command can be used to attempt to examine the contents of the
drive without causing more damage?
a. debugfs-c
80. You are using the vi editor to change a file, and you need to exit.
You receive a notice indicating “No write since last change”.
Assuming you want to save your work, which of the following
commands will save your work and exit vi?
a. :wq
81. When you’re using systemctl to kill a process, what is the default
signal sent to a process?
a. SIGTERM
Page 10 of 20
CMIT 291 - LINUX
83. Which option changes the amount of time that grub waits before
booting into the operating system?
a. timeout
85. You suspect there is high CPU utilization on the system and need
to further troubleshoot. Which command can be used to obtain the
information required for troubleshooting this issue?
a. uptime
86. You need to redirect both STDERR and STDOUT to a file. Which
of the following character sequences accomplishes this task?
a. 2&>1
89. Which command is used with systemd in order to list the available
service units?
a. systemctl list-unit
Page 11 of 20
CMIT 291 - LINUX
93. Which YUM option displays the dependencies for the package
specified?
a. deplist
94. You need to enable the web server (running as the www-data user
and group) to write into a directory called /home/webfiles. Which
command/commands will accomplish this task in the most secure
manner?
a. Chgrp www-data /home/webfiles; chmod 775 /home/webfiles
95. You are working with a MySQL database and need to read in
several SQL commands from a file and send them into the MySQL
CLI for execution. You will be using STDIN redirection for this.
Which of the following commands is correct, assuming a filename of
customers.sql?
a. Mysql < customers.sql
Page 12 of 20
CMIT 291 - LINUX
99. Which option of the useradd command sets the number of days
between password expiration and when the account is disabled?
a. -f
100. You need to look at the information on logins beyond what was
captured by the current log file for the last command. Which option of
the last command can be used to load information from an alternate
file?
a. -f
101. Which option of the ioping command sets the number of requests
to send?
a. -c
104. Which command will search for a package named zsh on a Debian
system?
a. apt-cache search zsh
Page 13 of 20
CMIT 291 - LINUX
109. Which command can be used to search the contents of all files
below your current location for files that contain the characters DB?
a. grep -r “DB” *
110. You need to obtain a directory listing of all files and directories
except those that begin with the letter p. Which of the following
commands accomplishes this task?
a. ls -I [^p]*
113. Which option is used to change the number of lines of output for
the head and tail commands?
a. -n
114. Which type of module interface for PAM is used to set a policy
such as the time-of-day that a user can log in?
a. account
Page 14 of 20
CMIT 291 - LINUX
117. What time intervals are represented by the three numbers in the
load-average output obtained with the uptime command?
a. 1, 5, and 15
120. The SAN has crashed again, and one of the filesystems in a Linux
server has become significantly corrupt as a result. Which command
can be used to attempt to examine the contents of the drive without
causing more damage?
a. debugfs -c
121. Which command will output a new GRUB configuration file and
send the output to the correct location for booting?
a. update-grub
Page 15 of 20
CMIT 291 - LINUX
a. renice -5 -p 4382
123. Which git command shows the current state of the working copy of
a repository?
a. git status
128. The default format for an OVF template uses which document
standard?
a. XML
129. You need to run the ./myscript.sh script with a nondefault priority
setting. Which of the following commands will accomplish this task?
a. nice -n 10 ./myscript.sh
Page 16 of 20
CMIT 291 - LINUX
132. Which of the following best describes the result of the command
cat/etc/passwd | cut-d:-f1 > users.txt?
a. The first field will be extracted from the passwd file and placed
into a file called users.txt.
133. Which command can be used to trigger the kernel to update the
partition table?
a. partprobe
136. You want to add the NFS service to the public zone in firewalld.
Which command will accomplish this?
a. sudo firewall-cmd -- add-service=nfs --zone=public
138. You have added a swap disk to a Linux server and have executed
mkswap. However, on examination of the output from the free
Page 17 of 20
CMIT 291 - LINUX
command, you see that the swap space is not being used. Which
command do you need to execute?
a. swapon
144. Which file contains a list of keys that will be accepted for
authentication for a given user?
a. ~/.ssh/authorized_keys
Page 18 of 20
CMIT 291 - LINUX
145. You would like to run several commands in succession but not
have the output sent into the next command. Which of the following
metacharacters will accomplish this task?
a. ; (semicolon)
147. Working with a file called test.php to determine line count, the
output from the wc command is 14 18 293 test.php. Which one of the
three digits corresponds to line count?
a. 14
148. You need to change the startup arguments for a service managed
by systemd. Which line within the unit file is used for this purpose?
a. ExecStart
150. Which PAM module can be used to lock accounts after failed login
attempts?
a. Pam_tally2
151. Which file contain information about the filesystems to mount them
and their partitions within the system?
a. /etc/fstab
Page 19 of 20
CMIT 291 - LINUX
153. Within which directory will you find files related to the time zone for
various regions?
a. /usr/share/zoneinfo
155. Which option to renice will increase the priority for all processes by
the apache user?
a. renice -1 -u apache
159. Which option for the wc command prints the number of lines
given as input?
a. -l
Page 20 of 20