CMIT 291 - LINUX
Final Exam: Intro to Linux
1. Which command can be used to print using a specially formatted
string?
a. printf
2. Which port does slapd LDAP daemon listen for connections?
a. 389
3. Which commands examine /etc/passwd to find users that are using
either /bin/bash or /usr/bin/zsh for their shell environment?
a. egrep’/*/..?sh$’/etc/passwd
4. Default number of lines printed by head and tail commands?
a. 10 for both head and tail
5. A file called test.php to determine line count, output from the wc
command is 1418293 test.php. Which of these three digits
corresponds to line count?
a. 14
6. Which is the correct name for JSON?
a. JavaScript Object Notation
7. Which port does slapd LDAP daemon list for connections?
a. 389
8. Which server role should be implemented to speed up web browsing
for local clients?
a. Web proxy
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)
12. Which of the following are filter commands?
a. Grep, egrep, cut
13. Which statement best describes ls and -la command?
Lrwxrwxrwx.1 root root 35 Jul
2014.fetchmailrc->.configs/fetchmail/.fetchmailrc
a. It is a file called .fetchmailrc that is linked using a symbolic link
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
19. You need to delete files in a directory as well as any empty
subdirectories. You want to be asked permission before deleting
each file and receive detailed information as the command executes.
Which command and option combination should you use?
a. Rm-ivd directory
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
21. What is the default delimiter used by the cut command?
a. Tab
22. Which option for the wc command prints the number of lines given
as input?
a. -l
23. Which web server has gained popularity as a high-performance
load balancer?
a. nginX
24. Which of the following symbols could be used to redirect
STDOUT?
a. >
b. L
c. >>
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
26. Which of the following is a required section within a systemd
service unit file?
a. [Service]
27. Which of the following commands provides a command-line
interface into Network Manager?
a. Nmcli
28. Which of the following commands scans the IP address
192.168.1.154 for open ports?
a. nmap 192.168.1.154
29. Which command can be used to obtain extended hardware and
device information, including information about the motherboard?
a. dmidecode
30. Which systemctl command needs to be executed after making a
change to a systemd-related configuration file?
a. systemctl daemon-reload
31. Which command displays Desktop Management interface
information?
a. dmidecode
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
33. Which file contains information on currently mounted filesystems,
including their mount options?
a. /etc/mtab
34. Which command can be used to list all of the detected hardware
within a system?
a. Lshw
35. A device mismatch is reported by pvs. Which command rescans
volume groups after resolving the mismatch?
a. vgscan
36. Which docker command creates a container from an image and
starts that image?
a. run
37. Which of the following terms is used in orchestration and
automation scenarios to refer to the collection of devices being
managed?
a. Inventory
38. Which command is used to remove unused filesystem blocks from
thinly provisioned storage?
a. fstrim
39. According to the Filesystem Hierarchy Standard (FHS), what is the
correct location for add-on application storage software packages?
a. /opt
40. Which of the following commands helps you to determine
information about a given window within an X session, including
information on the window size and its position?
a. xwininfo
Page 5 of 20
CMIT 291 - LINUX
41. Which of the following commands can be used to display the
current disk utilization, including free space?
a. df
42. Which command is used to turn off AppArmor profiles?
a. Aa-disable
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
44. You are troubleshooting a service not starting on time. Which
network unit target waits until the network is up, such as with the
routable IP address?
a. network-online.target
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
48. You need to examine who is currently logged in to the system.
Which of the following commands will display this information?
a. w
Page 6 of 20
CMIT 291 - LINUX
49. Which command is used to load a module and its dependencies
automatically?
a. modprobe
50. When working in a virtual server environment, which column within
iostat output shows the amount (percentage) of time spent in an
involuntary wait scenario due to the hypervisor?
a. steal
51. Which of the following command lines would monitor a single
process called nagios in a continuous manner?
a. top -p’ pidof nagios
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
54. Which command displays the contents of the PATH variable in
Bash?
a. echo $PATH
55. Which command can be used to view the kernel ring buffer in
order to troubleshoot the boot process?
a. Dmesg
56. When running useradd, which option needs to be specified in
order for the user’s home directory to be created?
a. -m
57. Which git command is used to display a short history of commits
along with the commit ID?
Page 7 of 20
CMIT 291 - LINUX
a. log
58. Which of the following commands changes a file called script.sh,
which is located in your home directory, such that it can be executed
by the owner of the file and no one else?
a. Chmod 700 ~/script.sh
59. Which of the following commands saves the current set of iptables
rules into a file?
a. Iptables-save
60. Which git command is used to display a short history of commits
along with the commit ID?
a. Log
61. Which of the following commands can be used to generate a
private and public key pair for authentication with SSH?
a. ssh-keygen
62. Which command is used to add a group to the system?
a. groupadd
63. Which of the following commands will send the contents of
/etc/passwd to both STDOUTn and a file called passwordfile?
a. cat / etc / passwd | tee passwordfile
64. Which option of the quotacheck command is used to create the
files for the first time?
a. -c
65. When running useradd, which option needs to be specified in
order for the user’s home directory to be created?
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
70. Which command is used to obtain a list of USB devices?
a. Lusb
71. Which background process runs to maintain the list of snap
packages available on an Ubuntu system?
a. snapd
72. On which port does the slapd LDAP daemon listen for
connections?
a. 389
73. Which of the following commands adds a default gateway of
192.168.1.1 for interface eth0?
a. route add gateway gw 192.168.1.1. eth0
74. Within which directory will you find the repositories used by yum?
a. /etc/yum.repos.d
Page 9 of 20
CMIT 291 - LINUX
75. Which of the following describes a primary difference between
traceroute and tracepath?
a. The tracepath command provides the MTU for each hop,
whereas the traceroute command does not.
76. A piece of software on client machines that listens for connections
and executes commands on behalf of the server in an orchestration is
commonly known as which of the following?
a. Agent
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
82. When working with a network configuration, which of the following
terms refers to a computer with two network interfaces?
a. Dual-homed
83. Which option changes the amount of time that grub waits before
booting into the operating system?
a. timeout
84. Which signal number corresponds to SIGKILL?
a. 9
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
87. Which of the following packages orchestration for Linux in an
agentless manner?
a. Ansible
88. When troubleshooting a connectivity issue, you have found that
you can reach a server via the Web but cannot ping it and suspect
that there are dropped packets. Which of the following best
describes a possible cause for this scenario?
a. ICMP traffic has been blocked
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
90. When using the dm-crypt command, which type of encryption is
used by default?
a. LUKS
91. Which of the following commands can be used to display the
network information about TCP connections on a Linux system?
a. netstat -t
92. Which of the following best describes the relationship between
pods and container with Kubernetes?
a. Pods can contain multiple container
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
96. Which of the following commands can be used to find zombie
processes?
a. ps | grep Z
97. Which option on a filesystem will enable user-level quotas?
a. usrquota
Page 12 of 20
CMIT 291 - LINUX
98. Which command shows the background processes related to the
current shell?
a. jobs
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
102. Configuration of udev devices is done by working with files in
which directory?
a. /etc/udev
103. Which docker command sends an image to the Docker Hub
registry or to a local registry?
a. push
104. Which command will search for a package named zsh on a Debian
system?
a. apt-cache search zsh
105. Which systemd target can be used as an alternative to rescue
mode when recovery is not possible in rescue mode?
a. emergency
Page 13 of 20
CMIT 291 - LINUX
106. Which option of the journalctl command displays the output in
reverse, with the newest entries first?
a. -r
107. Which command can be used to display information about current
file attributes?
a. lsattr
108. Which command can be used to change the size of a logical
volume when using Logical Volume Manager?
a. lvresize
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]*
111. Which command can be used to convert lowercase letters to
uppercase letters across an entire file?
a. tr
112. What type of hypervisor is the Oracle VirtualBox application?
a. Type II
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
115. Which of the following best describes an overlay network when
used with technology such as Kudernetes?
a. An overlay network is a virtual network used for communication
between containers.
116. Which of the following commands initializes a physical disk
partition for use with LVM?
a. pvcreate
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
118. Which git command is used to retrieve a repository from a remote
server?
a. clone
119. Which of the following describes a primary difference between
traceroute and tracepath?
a. The tracepath command provides the MTU for each hop,
whereas the traceroute command does not.
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
122. You need to increase the performance of process ID 4382 by
changing its priority. Which of the following commands will
accomplish this task?
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
124. Which statement can be used in a Bash script if variable $num1 is
greater than $num2, assuming both variables contain integers?
a. If [ “$num1” gt “$num2” ]
125. Which command is used to change the SELinux type of a file?
a. chcon
126. Which of the following commands will search each user’s
.bash_history file to determine if the user has invoked the sudo
command?
a. find /home -name “.bash_history” | xargs grep sudo
127. Which of the following is true of Linux swap space?
a. Swap is used as additional memory when there is insufficient
RAM.
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
130. Which of the following options within an OpenSSH server
configuration is used to determine whether the root user can log in
directly with an SSH client?
a. PermitRootLogin
Page 16 of 20
CMIT 291 - LINUX
131. Within the [Timer] section of a systemd timer file, which
configuration directive is used to specify the process or service to
start?
a. Unit=
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
134. When using Kerberos authentication, which of the following
commands shows the ticket cache?
a. klist
135. Which docker command displays detailed information about a
container?
a. inspect
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
137. When sourcing a file in bash, which chmod command would be
necessary to provide the minimum privileges in order for the file to be
sourced correctly, assuming that your current user owns the file?
a. chmod 400
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
139. Which command displays network usage in a top-like interface?
a. iftop
140. Which of the following commands displays a listing of the users
logged in to the server along with the date and time that they logged
in?
a. who
141. Which of the following commands creates a logical volume with
LVM?
a. lvcreate
142. A developer is reporting that their webpage called index.html
cannot be viewed on the web. While re-creating the issue, you
receive the error “Forbidden” in a web browser and you notice that
the file’s permission appear as -rw-- - - - on the server. Using this
information, which of the following describes the problem and its
solution and, if applicable, the command to correct this issue?
a. The file’s permissions do not allow the file to be read and the
chmod 644 command will correct the issue.
143. Which locale-related variable is used for currency-related
localization?
a. LC_MONETARY
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)
146. Which option within /etc/login.defs is used to configure the
maximum number of days until a password change is required?
a. PASS_MAX_DAYS
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
149. Which option of the useradd command creates a system user
rather than a normal user?
a. -r
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
152. Which of the following commands provides an overview of the
current memory usage along with swap space and its current
utilization?
a. free
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
154. Assuming that /var/log/journal exists, which type of storage is used
when the Storage= option is set to auto within journald.conf?
a. persistent
155. Which option to renice will increase the priority for all processes by
the apache user?
a. renice -1 -u apache
156. Which of the following commands is used to display the currently
loaded modules on a running system?
a. lsmod
157. Which of the following commands can be used to print the
contents of the current shell environment?
a. printenv
158. Which command can be used to listen for netlink messages on a
network?
a. ip monitor
159. Which option for the wc command prints the number of lines
given as input?
a. -l
160. Which utility can be used to find SELinux context violations?
a. ausearch
Page 20 of 20