Linux has become one of the fastest growing operating systems used in server environments. Most companies utilize some type of Linux system within their infrastructure, and Linux is one of the major players in the cloud computing world. The ability to build and manage Linux systems is a skill that many companies are now looking for. The more you know about Linux, the more marketable you’ll become in today’s computer industry.
The purpose of this book is to provide you with the knowledge and skills you need to succeed in the Linux world.
The CompTIA Linux+ exam has become a benchmark in the computer industry as a method of demonstrating skills with the Linux operating system. Obtaining CompTIA Linux+ certification means that you’re comfortable working in a Linux environment and have the skills necessary to install and maintain Linux systems.
Previously, CompTIA had partnered with the Linux Professional Institute (LPI) to produce the Linux+ certification exams. With the release of exam XK0-004 in early 2019, CompTIA has gone solo and created its own exam. The updated Linux+ certification is now a single exam that covers more hands-on components of operating a Linux system. The updated Linux+ exam focuses on five core areas of Linux:
The XK0-004 exam uses performance-based, multiple-choice, and multiple-answer questions to identify employees who can perform the job of Linux system administrator. The exam covers tasks associated with all major Linux distributions, not focusing on any one specific distribution. It consists of 90 questions, and you will have 90 minutes to complete it.
With the growing popularity of Linux (and the increase in Linux-related jobs) comes hype. With all of the hype that surrounds Linux, it’s become hard for employers to distinguish employees who are competent Linux administrators from those who just know the buzzwords. This is where Linux+ certification comes in.
With a Linux+ certification, you will establish yourself as a Linux administrator who is familiar with the Linux platform and can install, maintain, and troubleshoot any type of Linux system. By changing the exam to be more performance based, CompTIA has established the new Linux+ exam as a way for employers to have confidence in knowing their employees who pass the exam will have the skills necessary to get the job done.
The Linux+ certification is available for anyone who passes the XK0-004 exam. There are no prerequisites to taking the exam, but CompTIA recommends having either the A+ and Network+ certifications or a similar amount of experience, along with at least 12 months of hands-on Linux administrator experience.
Pearson VUE administers the exam. The exam can be taken at any Pearson VUE testing center. To register for the exam, call Pearson VUE at (877) 619-2096, or register online at http://home.pearsonvue.com/comptia.
After you take the exam, you will be immediately notified of your score. If you pass, you will get a certificate in the mail showing your Linux+ certification credentials along with a verification number that employers can use to verify your credentials online.
The new Linux+ exam is part of CompTIA’s Continuing Education (CE) track of exams. The new Linux+ exam is valid for three years, but it can be renewed by acquiring an appropriate number of Continuing Education Units (CEUs) and paying a yearly fee.
While anyone who wants to pass the Linux+ certification exams would benefit from this book, that’s not the only reason for purchasing it. This book covers all the material someone new to the Linux world would need to know to start out in Linux. After you’ve become familiar with the basics of Linux, the book will serve as an excellent reference for quickly finding answers to everyday Linux questions.
The book is written with the assumption that you have a familiarity with basic computer and networking principles. While no experience with Linux is required to benefit from this book, it will help if you know your way around a computer in either the Windows or macOS worlds, such as how to use a keyboard, use optical disks, and work with USB thumb drives.
It will also help to have a Linux system available to follow along with. Many chapters contain a simple exercise that will walk you through the basic concepts presented in the chapter. This provides the crucial hands-on experience that you’ll need, to both pass the exam and do well in the Linux world.
While the CompTIA Linux+ exam is Linux distribution neutral, it’s impossible to write exercises that work in all Linux distributions. That said, the exercises in this book assume you have either Ubuntu 18.04 LTS or CentOS 7 available. You can install either or both of these Linux distributions in a virtual environment using the Oracle VirtualBox software, available at https://virtualbox.org.
This book consists of 30 chapters organized around the different objective areas of the Linux+ exam:
We’ve included several study learning tools throughout the book:
The assessment test, review questions, and other testing elements included in this book are not derived from the actual Linux+ exam questions, so don’t memorize the answers to these questions and assume you will pass the exam. You should learn the underlying topics, as described in the text of the book. This will help you answer the questions provided with this book and pass the exam. Learning the underlying topics is also the approach that will serve you best in the workplace, the ultimate goal of the certification.
To get the most out of this book, you should read each chapter from start to finish and then check your memory and understanding with the chapter review questions. Even if you’re already familiar with a topic, it will help to review the material in the chapter. In Linux there are often multiple ways to accomplish a task. It will help to at least be familiar with the different methods to help with the Linux+ exam.
The interactive online learning environment that accompanies the book provides a test bank with study tools to help you prepare for the certification exam and increase your chances of passing it the first time. The test bank includes the following:
Go to http://www.wiley.com/go/sybextestprep to register and gain access to this interactive online learning environment and test bank with study tools.
This book uses certain typographic styles in order to help you quickly identify important information and avoid confusion over the meaning of words such as onscreen prompts. In particular, look for the following styles:
A monospaced font
indicates the contents of configuration files, messages displayed at text-mode Linux shell prompts, filenames, text-mode command names, and Internet URLs.Italicized
monospace
text
indicates a variable, or information that differs from one system or command run to another, such as the name of a file or a process ID number.Bold monospace text
is information that you’re to type into the computer, usually at a Linux shell prompt. This text can also be italicized to indicate that you should substitute an appropriate value for your system. (When isolated on their own lines, commands are preceded by non-bold monospace $ or # command prompts, denoting regular user or system administrator user, respectively.)In addition to these text conventions, which can apply to individual words or entire paragraphs, a few conventions highlight segments of text, as in the following examples:
A note indicates information that’s useful or interesting but that’s somewhat peripheral to the main text. A note might be relevant to a small number of networks, for instance, or it may refer to an outdated feature.
A tip provides information that can save you time or frustration and that may not be entirely obvious. A tip might describe how to get around a limitation or how to use a feature to perform an unusual task.
Warnings describe potential pitfalls or dangers. If you fail to heed a warning, you may end up spending a lot of time recovering from a bug, or you may even end up restoring your entire system from scratch.
A sidebar is like a note but longer. The information in a sidebar is useful, but it doesn’t fit into the main flow of the text.
A case study is a real-world scenario is a type of sidebar that describes a task or example that’s particularly grounded in the real world. This may be a situation we or somebody we know has encountered, or it may be advice on how to work around problems that are common in real-world, working Linux environments.
An exercise is a procedure that you should try on your own computer to help you learn about the material in the chapter. Don’t limit yourself to the procedures described in the exercises, though. Try other commands and procedures to truly learn about Linux.
The exam objectives define the topics you can expect to find in the CompTIA Linux+ exam. The exam developers have determined that these topics are relevant to the skills necessary to become a competent Linux administrator and have based the exam questions on your ability to demonstrate your knowledge in these topics. The official CompTIA Linux+ XK0-004 exam topics are listed here, along with references to where you can find them covered in the book.
What software package allows a Linux server to share folders and printers with Windows and Mac clients?
Which software package allows developers to deploy applications using the exact same environment in which they were developed?
The cat -n File.txt
command is entered at the command line. What will be the result?
File.txt
will be displayed.File.txt
will be displayed along with any special hidden characters in the file.File.txt
will be displayed along with any special symbols representing end-of-line characters.File.txt
will be displayed along with line numbers.File.txt
will be displayed in reverse order.Which of the following are stream editors? (Choose all that apply.)
vim
sed
awk
gawk
nano
Which command in GRUB2 defines the location of the /boot
folder to the first partition on the first hard drive on the system?
set root=hd(0,1)
set root=hd(1,0)
set root=hd(1,1)
set root=hd(0,0)
set root=first
If you see read or write errors appear in the system log, what tool should you use to correct any bad sections of the hard drive?
mount
unmount
fsck
dmesg
mkinitrd
The init
program is started on a Linux system and has a process ID number. What typically is that process’s ID number?
You need to determine the default target of a systemd system. Which of the following commands should you use?
grep initdefault /etc/inittab
runlevel
systemctl is-enabled
systemd get-target
systemctl get-default
The Cinnamon desktop environment uses which windows manager?
Your X11 session has become hung. What keystrokes do you use to restart the session?
What folder contains the time zone template files in Linux?
etc/timezone
etc/localtime
usr/share/zoneinfo
usr/share/timezone
usr/share/localtime
What systemd command allows you to view and change the time, date, and time zone?
timedatectl
localectl
date
time
locale
Which of the following files contain user account creation directives used by the useradd
command? (Choose all that apply.)
/etc/default/useradd
file/etc/useradd
file/etc/adduser.conf
file/etc/login.defs
file/etc/login.def
fileYou need to display the various quotas on all your filesystems employing quota limits. Which of the following commands should you use?
edquota -t
quotaon -a
quotacheck -cu
quotacheck -cg
repquota -a
What drive and partition does the raw device file /dev/sdb1
reference?
What tool creates a logical volume from multiple physical partitions?
mkfs
pvcreate
lvcreate
fdisk
vgcreate
Which of the following can be used as backup utilities? (Choose all that apply.)
gzip
utilityzip
utilitytar
utilityrsync
utilitydd
utilityA system administrator has created a backup archive and transferred the file to another system across the network. Which utilities can be used to check the archive files integrity? (Choose all that apply.)
rsync
utilitymd5sum
utilitysftp
utilityscp
utilitysha512sum
utilityWhat tool should you use to install a .deb
package file?
dpkg
tar
gcc
rpm
gzip
What tool do you use to install a .rpm
package file?
dpkg
tar
gcc
rpm
gzip
The lsmod
utility provides the same information as what other utility or file(s)?
modinfo
utility/proc/modules
file/etc/modules.conf
fileinsmod
utility/run/modprobe.d/*.conf
filesWhich utility should be used to remove a module along with any dependent modules?
rmmod
utilitymodinfo
utilitycut
utilitydepmod
utilitymodprobe
utilityWhat special bit should you set to prevent users from deleting shared files created by someone else?
What command can you use to change the owner assigned to a file?
chmod
chown
chage
ulimit
chgrp
The ______ directory contains the various PAM configuration files.
/etc/pam/
directory/etc/pam_modules/
directory/etc/modules/
directory/etc/pam.d/
directory/etc/pam_modules.d/
directoryWhich of the following can override the settings in the ~/.ssh/config
file?
/etc/ssh/ssh_config
file.ssh
utility’s command-line options./etc/ssh/sshd_config
file.sshd
daemon’s configuration file.What command can you use to display new entries in a log file in real time as they occur?
head
tail
tail -f
head -f
vi
What command do you use to display entries in the systemd-journald
journal?
journalctl
syslogd
klogd
systemd-journald
vi
The /etc/services
file may be used by firewalls for what purpose?
Which of the following is true about netfilter? (Choose all that apply.)
Which of the following is a measurement of the maximum amount of data that can be transferred over a particular network segment?
Which tool will allow you to view disk I/O specific to swapping?
ipcs -m
cat /proc/meminfo
free
swapon -s
vmstat
What command-line command allows you to view the applications currently running on the Linux system?
lsof
kill
ps
w
nice
What command-line commands allow you to send process signals to running applications? (Choose two.)
renice
pkill
nice
kill
pgrep
Annika puts the file line PS1="My Prompt: "
into her account’s $HOME/.bash_profile
file. This setting changes her prompt the next time she logs into the system. However, when she starts a subshell, it is not working properly. What does Annika need to do to fix this issue?
$HOME/.profile
file instead.export
prior to PS1
on the same line in the file./bin/dash
for this to work./sbin/false
.A user, who is not the owner or a group member of a particular directory, attempts to use the ls
command on the directory and gets a permission error. What does this mean?
d
) set for other permissions.x
) set for other permissions.w
) set for other permissions.l
) set for other permissions.r
) set for other permissions.Which directories contain dynamic files that display kernel and system information? (Choose two.)
/dev
/proc
/etc
/sys
/dev/mapper
What directory contains configuration information for the X Windows System in Linux?
/dev
/proc
/etc/X11
/sys
/proc/interrupts
How would you fix a “mount point does not exist” problem?
fsck
utility to fix the bad disk sector.badblocks
utility to fix the bad disk sector.vgchange
command.mkdir
command.mountpoint
command.Peter is trying to complete his network application, Spider, but is running into a problem with accessing a remote server’s files and there are no network problems occurring at this time. He thinks it has something to do with the remote server’s ACLs being too restrictive. You need to investigate this issue. Which of the following might you use for troubleshooting this problem? (Choose all that apply.)
firewall-cmd
commandufw
commandiptables
commandgetacl
commandsetacl
commandWhich Bash shell script command allows you to iterate through a series of data until the data is complete?
if
case
for
exit
$()
Which environment variable allows you to retrieve the numeric user ID value for the user account running a shell script?
$USER
$UID
$BASH
$HOME
$1
What does placing an ampersand sign (&
) after a command on the command-line do?
When will the cron table entry 0 0 1 * * myscript
run the specified command?
Which of the following packages will provide you with the utilities to set up Git VCS on a system?
git-vcs
GitHub
gitlab
Bitbucket
git
If you do not tack on the -m
option with an argument to the git commit
command, what will happen?
COMMIT_EDITMSG
file.At a virtualization conference, you overhear someone talking about using blobs on their cloud-based virtualization service. Which virtualization service are they using?
“A networking method for controlling and managing network communications via software that consists of a controller program as well as two APIs” describes which of the following?
Your company decides it needs an orchestration system (also called an engine). Which of the following is one you could choose? (Choose all that apply.)
Which of the following is used in container orchestration? (Choose all that apply.)
What type of cloud service provides the full application environment so that everyone on the Internet can run it?
What type of hypervisor is the Oracle VirtualBox application?
What file should you place console and terminal file names into to prevent users from logging into the Linux system as the root user account from those locations?
/etc/cron.deny
/etc/hosts.deny
/etc/securetty
/etc/login.warn
/etc/motd
What Linux program logs user file and directory access?
chroot
auditd
klist
kinit
You’ve moved your present working directory to a new location in the Linux virtual directory structure and need to go back to the previous directory, where you were just located. Which command should you employ?
cd
exit
cd ~
cd -
return
To copy a directory with the cp
command, which option do you need to use?
-i
-R
-v
-u
-f
cat -n File.txt
command will display the File.txt
text file along with line numbers. Therefore, option D is correct. The command in option A will simply display the File.tx
t file. Thus, option A is a wrong answer. To see any special hidden characters within the File.txt
file, you would need to enter the command cat -A File.txt
. Therefore, option B is an incorrect choice. End-of-line characters need a different cat
command option, such as the -E
switch. Therefore, option C is a wrong choice. The cat
command does not have a switch that will allow a text file’s contents to be displayed in reverse order. Thus, option E is an incorrect choice.sed
, awk
, and gawk
utilities are all stream editors. Therefore, options B, C, and D are correct. Both vim
and nano
are considered to be text editors. Therefore, options A and E are incorrect choices.first
, which is not recognized by GRUB2, so it is incorrect.fsck
program can perform a filesystem check and repair multiple types of filesystems on partitions, so option C is correct. The mount
program is used to append a partition to a virtual directory; it can’t correct a partition that contains errors, so option A is incorrect. The unmount
command removes a partition from the virtual directory, so option B is incorrect. Option D (the dmesg
command) displays boot messages, and option E (the mkinitrd
command) creates an initrd RAM disk, so both are incorrect.init
program is typically started immediately after the Linux system has traversed the boot process, and it has a process ID (PID) number of 1. Therefore, option B is the correct answer. The Linux kernel has the 0 PID number, and thus, option A is a wrong answer. Options C, D, and E are also incorrect choices.systemctl get-default
command will display a systemd system’s default target. Therefore, option E is the correct answer. The grep initdefault /etc/inittab
command will extract the default runlevel for a SysV init system. Thus, option A is a wrong answer. The runlevel
command will display a SysV init system’s previous and current runlevel. Therefore, option B is an incorrect answer. The systemctl is-enabled
command shows whether or not a particular service, whose name is passed as a command argument, is configured to start at system boot. Thus, option C is a wrong choice. Option D is a made-up command and therefore the wrong answer./usr/share/zoneinfo
folder, so option C is correct. The /etc/timezone
and /etc/localtime
files contain the current time zone file for Debian- and Red Hat–based systems, not the time zone template files, so options A and B are incorrect. The /usr/share/timezone
and /usr/share/localtime
folders don’t exist in either Debian-based or Red Hat–based Linux distributions, so options D and E are also incorrect.timedatectl
program is part of the systemd package and allows you to both view and change the current time, date, and time zone for the Linux system, so option A is correct. The localectl
program is also part of the systemd package, but it handles localization information and not time and date information, so option B is incorrect. The date
command allows you to view and change the time and date but not the time zone setting, so option C is incorrect. The time
command displays the elapsed CPU time used by an application, not the current time, date, and time zone, so option D is incorrect. The locale
command allows you to view the localization settings for the Linux system, not the time, date, or time zone, so option E is also incorrect./etc/default/useradd
file and /etc/login.defs
file are files that contain user account creation directives used by the useradd
command. Therefore, options A and D are the correct answers. Option B’s /etc/useradd
file is a made-up file name, and thus option B is a wrong choice. The /etc/adduser.conf
file is only on Linux distributions that use the adduser
utility to create accounts. Thus, option C is an incorrect answer. The /etc/login.def
file is a made-up file name, and thus option E is also an incorrect choice.repquota -a
command will display the various quotas on all your filesystems employing quota limits. Therefore, option E is the correct answer. The edquota -t
command will edit quota grace periods for the system. Therefore, option A is a wrong answer. The quotaon -a
command will automatically turn on quotas for all mounted non-NFS filesystems in the /etc/fstab
file, but it does not display filesystems’ quotas. Thus, option B is an incorrect choice. The quotacheck
utility creates either the aquota.group
file, if the -cg
options are used, or the aquota.user
file, if the -cu
switches are used, or both files if -cug
is employed. However, it does nothing for displaying filesystems’ quotas. Thus, options C and D are incorrect answers./dev/sd
xx
format for SCSI and SATA raw devices. The device is represented by a letter, starting with a, and the partition is represented by a number, starting at 1. So /dev/sdb1
references the first partition on the second SCSI or SATA device. Option B would be referenced by the /dev/sda2
file, so it is incorrect. Option C would be referenced by the /dev/hdb1
file, so it is incorrect. Option D would be referenced by /dev/hda2
, so option D is incorrect, and option E would be referenced by /dev/sdb2
, so it is incorrect.lvcreate
program creates a logical volume from multiple partitions that you can use as a single logical device to build a file system and mount it to the virtual directory, so option C is correct. The mkfs
program creates a filesystem on a partition, but doesn’t create a logical volume, so option A is incorrect. The pvcreate
program identifies a physical volume from a partition but doesn’t create the logical volume, so option B is incorrect. The fdisk
program creates and modifies physical partitions, not logical volumes, so option D is incorrect. The vgcreate
program creates a volume group for grouping physical partitions, but doesn’t create the logical volume, so option E is incorrect.zip
, tar
, rsync
, and dd
utilities all can be used to create data backups. Therefore, options B, C, D, and E are correct answers. The gzip
utility can be used after a backup is created or employed through tar
options to compress a backup, so option A is the only wrong choice.md5sum
and sha512sum
utilities produce hashes on files, which can be compared to determine if file corruption occurred, such as when transferring a file over the network. Therefore, options B and E are the correct answers. The utilities mentioned in options A, C, and D will allow you to securely transfer files but not check a file’s integrity. Therefore, options A, C, and D are incorrect choices.dpkg
program is used for installing and removing Debian-based packages that use the .deb
file format, so option A is correct. The tar
program is used for creating and extracting tape archive formatted files that use the .tar
file extension, so option B is incorrect. The gcc
program is used for compiling source code into executable programs, so option C is incorrect. The rpm
program is used for installing and removing Red Hat–based packages that use the .rpm
file format, so option D is incorrect. The gzip
program compresses files and adds the .gz
file extension to them, so option E is incorrect.rpm
program is used for installing and removing Red Hat–based packages that use the .rpm
file format, so option D is correct. The dpkg
program is used for installing and removing Debian-based packages that use the .deb
file format, so option A is incorrect. The tar
program is used for creating and extracting tape archive formatted files that use the .tar
file extension, so option B is incorrect. The gcc
program is used for compiling source code into executable programs, so option C is incorrect. The gzip
program compresses files and adds the .gz
file extension to them, so option E is incorrect./proc/modules
file has the same information that is displayed by the lsmod
utility (though the lsmod
utility formats it much nicer). Therefore, option B is the correct answer. The modinfo
utility provides detailed module data, while lsmod
only shows brief information. Thus, option A is a wrong answer. The /etc/modules.conf
file is a kernel module configuration file, and it does not provide the same information as the lsmod
utility. Therefore, option C is also an incorrect answer. The insmod
command is used to dynamically load kernel modules, and thus it is a wrong answer. The /run/modprobe.d/*.conf
files are kernel module configuration files, and they do not provide the same information as the lsmod
utility. Therefore, option E is also an incorrect choice.modprobe
utility along with its -r
switch is the utility to employ for removing (unloading) a kernel module along with any of its dependencies. Therefore, option E is the correct answer. The rmmod
utility will remove a kernel module but not any of its dependencies. Thus, option A is a wrong answer. The modinfo
command does not unload kernel modules but instead displays detailed information concerning a specified module. Therefore, option B is an incorrect choice. The cut
utility is used to filter text files and display the filtered text to STDOUT. It is not involved in kernel module removal, and thus option C is a wrong choice. The depmod
utility is used to create a list of modules and their dependencies. But it is not used to remove modules. Therefore, option D is an incorrect choice.chown
command allows you to set both the owner and group assigned to a file, so option B is correct. The chmod
command allows you to change the permissions for the file, but not the owner of the file, so option A is incorrect. The chage
command manages password aging for user accounts, not owners of files, so option C is incorrect. The ulimit
command allows the administrator to restrict system resources assigned to users but doesn’t assign users to files, so option D is incorrect. The chgrp
command allows you to change the group assigned to a file but not the owner, so option E is incorrect./etc/pam.d/
directory contains the various PAM configuration files. Therefore, option D is the correct answer. The other directory names are made up. Thus, options A, B, C, and E are incorrect answers.~/.ssh/config
file can be overridden by various ssh
utility options provided at the command line. Therefore, option B is the correct answer. The settings in the /etc/ssh/ssh_config
file can be overridden by both the settings in the ~/.ssh/config
file and the ssh
utility’s command-line options, so option A is a wrong answer. The /etc/ssh/sshd_config
file is the sshd
daemon’s configuration file, and it deals with providing the SSH services, not in setting the configuration for the SSH client. Therefore, both options D and E are incorrect choices.-f
option of the tail
command displays new additions to a file in real time, so option C is correct. The head
and tail
commands by themselves just list the existing entries in a file, so options A and B are incorrect. The head
command doesn’t support the -f
option, so option D is incorrect. The vi
editor also only displays existing data in a file and not newly added data, so option E is incorrect.systemd-journald
application uses its own binary file format for the journal file and requires the journalctl
file to read it, so option A is correct. The syslogd
and klogd
applications are syslog loggers and not able to read the systemd-journald
journal file, so options B and C are incorrect. The systemd-journald
application itself only adds event messages to the journal and doesn’t read it, so option D is incorrect. Since the journal file is in binary format, you can’t read it using standard text editor programs, so option E is incorrect./etc/services
file may be used by a firewall, such as UFW, to map a particular service name to its port and protocol. Thus, option C is the correct answer. The file is not used to designate remote services to block or store a firewall’s ACL rules. Therefore, options A and B are wrong answers. The Linux firewall applications do not use the /etc/services
file to determine if a port can be accessed or what local services can send out packets. Thus, options D and E are incorrect choices.vmstat
utility provides a lot of memory statistics, including disk I/O specific to swapping. Therefore, option E is the correct answer. The ipcs -m
command allows you to see shared memory segments instead of disk I/O specific to swapping. Thus, option A is the wrong answer. The cat /proc/meminfo
command displays detailed information concerning a system’s RAM. Therefore, option B is an incorrect answer. The free
command shows memory items such as free memory, used memory, and buffer/cache usage. Thus, option C is a wrong choice. The swapon -s
command displays swap space elements such as type, name, and priority. Therefore, option D is also an incorrect choice.ps
command with the proper options displays the active applications running on the Linux system, so option C is correct. The lsof
command displays the files currently open by applications but not all of the running applications, so option A is incorrect. The kill
command stops a running application based on its process ID; it doesn’t display all of the running applications, so option B is incorrect. The w
command displays all of the current users on the system but not all of the running applications, so option D is incorrect. The nice
command allows you to start a new application with a specified priority level, but it doesn’t allow you to display the currently running applications, so option E is incorrect.pkill
and kill
commands allow you to send Linux process signals to running applications, so options B and D are correct. The renice
command allows you to change the priority level of a running application but not send process signals to it, so option A is incorrect. The nice
command allows you to start an application with a specified priority level but not send process signals to applications that are already running, so option C is incorrect. The pgrep
command allows you to display running applications, but it doesn’t send process signals to them, so option E is incorrect.export
command prior to the PS1="My Prompt: "
in Annika’s environment file. When this environment variable is exported and when it is set, it will be set in any started subshells. Thus, option C is the correct answer. Since Annika’s environment file exists, the $HOME/.profile
file is not used. Thus, option A is a wrong answer. A user prompt can be changed in a subshell, so option B is also an incorrect answer. Changing Annika’s default shell will not fix this issue, so option D is a wrong choice. If Annika changes the last field in her password record to /sbin/false
, she will no longer be able to log into the system using her account. Therefore, option E is an incorrect choice.r
) set for other permissions if the user is not the directory’s owner or does not belong to the directory’s set group. Therefore, option E is the correct answer. There is no display (d
) permission setting, so option A is a wrong answer. The execute (x
) permission allows a user to change their present working directory to that directory as long as all the parent directories also have that permission set. Thus, option B is a wrong choice. The write (w
) permission allows a user to create files within that directory, so option C is an incorrect answer. There is no list (l
) permission setting, so option D is also an incorrect choice./proc
and /sys
directories to produce dynamic files that contain information about the kernel and system, so options B and D are correct. The /dev
folder contains files for communicating with devices, not kernel and system information, so option A is incorrect. The /etc
directory contains application configuration files, not files created by the kernel for displaying kernel and system information, so option C is incorrect. The /dev/mapper
directory is used for virtual files mapped to physical device files for LVM and LUKS, not kernel information, so option E is incorrect./etc/X11
directory contains configuration files used by both the X.org and XFree86 applications for controlling the X Windows graphical environment on the Linux system, so option C is correct. The /dev
directory contains device files used to send and receive data from devices, not the X Windows configuration files, so option A is incorrect. The kernel uses the /proc
and /sys
directories to create dynamic files that show kernel and system information, not contain X Windows configuration files, so options B and D are incorrect. The /proc/interrupts
file contains information about hardware interrupts currently used by hardware devices on the system, not X Windows configuration files, so option E is incorrect.mkdir
command. Thus, option D is the correct answer. The problem does not concern a bad disk sector (and you cannot fix bad disk sectors with the badblocks
utility), so options A and B are wrong answers. You would employ the vgchange
command for a missing volume in a logical volume but not a missing directory. Therefore, option C is an incorrect answer. While the mountpoint
command does allow you to see if a particular directory is a mount point, it does not allow you to create a missing directory. Thus, option E is an incorrect choice as well.firewall-cmd
, ufw
, or iptables
command in the troubleshooting process. Thus, options A, B, and C are the correct answers. The getacl
and setacl
commands deal with file inheritance issues, and therefore options D and E are incorrect choices.for
command allows you to iterate through a series of data one by one until the data set is exhausted, so option C is correct. The if
and case
statements perform a single test on an object to determine if a block of commands should be run; they don’t iterate through data, so options A and B are incorrect. The exit
command stops the shell script and exits to the parent shell, so option D is incorrect. The $()
command redirects the output of a command to a variable in the shell script, so option E is incorrect.$UID
environment variable contains the numeric user ID value of the user account running the shell script, so option B is correct. The $USER
environment variable contains the text user name of the user account running the shell script, not the numerical user ID value, so option A is incorrect. The $BASH
environment variable contains the path to the executable Bash shell, so option C is incorrect. The $HOME
environment variable contains the location of the home directory of the user account running the shell, so option D is incorrect. The $1
positional variable contains the first parameter listed on the command-line command when the shell script was run, so option E is incorrect.&
) tells the shell to run the specified command in background mode in the console session, so option C is correct. The nohup
command is used to disconnect the command from the console session, so option A is incorrect. The at
command is used to schedule a command to run later, so option B is incorrect. The pipe symbol (|
) redirects the output from the command to another command, so option D is incorrect. The greater-than symbol (>
) redirects the output from the command to a file, so option E is incorrect.0 0 1 * *
will run the command at 00:00 (midnight) on the first day of the month for every month. That makes option B correct, and options A, C, D, and E incorrect.git
package provides utilities to set up Git VCS on a system, so option E is the correct answer. The git-vcs
package is made up, so option A is a wrong answer. The GitHub
, gitlab
, and Bitbucket
packages are also made up, but they have similar names as cloud-based remote repositories used with Git (GitHub, GitLab, BitBucket). Therefore, options B, C, and D are also incorrect choices.-m
option with an argument is not tacked onto the git commit
command, you are placed into the vim
editor to edit the COMMIT_EDITMSG
file. Thus, option C is the correct answer. All the other options are made up and therefore incorrect./etc/securetty
file provides a list of locations from which users can’t log in using the root user account, so option C is correct. The /etc/cron.deny
file prevents users from scheduling jobs, not logging in as the root user account, so option A is incorrect. The /etc/hosts.deny
file blocks access from remote network hosts; it doesn’t block root access from local terminals or the console, so option B is incorrect. The /etc/login.warn
and /etc/motd
files contain messages that are displayed at login time; they don’t block users from logging in as the root user account, so options D and E are incorrect.auditd
program monitors system activity, including user file and directory access, and logs events based on rules you create. Thus, option C is correct. The chroot
utility restricts applications to a specific location in the virtual filesystem but doesn’t log user file and directory access, so option A is incorrect. The LUKS system encrypts disk partitions but doesn’t log user file and directory access, so option B is incorrect. The klist
and kinit
programs are used for Kerberos user authentication, not logging user file and directory access, so options D and E are both incorrect.cd -
command will return your process to its previous directory in the virtual directory system, so option D is the correct answer. The cd
and cd ~
commands both return your process to your home directory, which was not necessarily the previous directory. Therefore, options A and C are wrong answers. The exit
command causes your process to exit its current shell, not return to the previous directory, so option B is also an incorrect answer. The return
command is used in Bash shell scripts to return from a function or return from a sourced script. Thus, option E is also an incorrect choice.-R
option used with the cp
command allows you to copy a directory’s contents. You can also employ the -r
or --recursive
options to achieve the same results. Therefore, option B is the correct answer. The -i
option will ask before overwriting a preexisting directory but not copy recursively, so option A is a wrong answer. The -v
option will provide verbose information for the copy, which is helpful, but does not allow a recursive copy to occur. Thus, option C is also an incorrect answer. The -u
option is handy in that it will only allow the cp
command to overwrite preexisting files with the same name, if the files being copied are newer. However, it is not used to recursively copy, so option D is also an incorrect answer. The -f
option forces a copy to occur and overwrites any preexisting files with the same name but does not force a recursive copy. Thus, option E is an incorrect choice.