Looking for more? Click here to get the full PDF with 222+ practice questions for $10 for offline study and deeper preparation.
Question 1
A cloud engineer needs to remove all dangling images and delete all the images that do not have an associated container. Which of the following commands will help to accomplish this task?
A. docker images prune -a
B. docker push images -a
C. docker rmi -a images
D. docker images rmi --all
Show Answer
Correct Answer:
A. docker images prune -a
Question 2
A Linux administrator is tasked with adding users to the system. However, the administrator wants to ensure the users’ access will be disabled once the project is over. The expiration date should be 2021-09-30. Which of the following commands will accomplish this task?
A. sudo useradd -e 2021-09-30 Project_user
B. sudo useradd -c 2021-09-30 Project_user
C. sudo modinfo -F 2021-09-30 Project_uses
D. sudo useradd -m -d 2021-09-30 Project_user
Show Answer
Correct Answer:
A. sudo useradd -e 2021-09-30 Project_user
Question 3
A systems administrator is customizing a new Linux server. Which of the following settings for umask would ensure that new files have the default permissions: -rw-r-----?
A. 0017
B. 0027
C. 0038
D. 0640
Show Answer
Correct Answer:
B. 0027
Question 4
An administrator runs ping comptia. org. The result of the command is: ping: comptia.org: Name or service not known Which of the following files should the administrator verify?
A. /etc/ethers
B. /etc/services
C. /etc/resolv.conf
D. /etc/sysctl.conf
Show Answer
Correct Answer:
C. /etc/resolv.conf
Question 5
Which of the following options represents disk mirroring?
A. RAID 0
B. RAID 1
C. RAID 5
D. RAID 6
Show Answer
Correct Answer:
B. RAID 1
Question 6
An administrator has source code and needs to rebuild a kernel module. Which of the following command sequences is most commonly used to rebuild this type of module?
A. /configure make make install
B. wget gcc cp
C. tar xvzf build cp
D. build install configure
Show Answer
Correct Answer:
A. /configure make make install
Question 7
A Linux engineer receives reports that files created within a certain group are being modified by users who are not group members. The engineer wants to reconfigure the server so that only file owners and group members can modify new files by default. Which of the following commands would accomplish this task?
A. chmod 775
B. umask. 002
C. chattr -Rv
D. chown -cf
Show Answer
Correct Answer:
B. umask. 002
Question 8
An administrator recently updated the BIND software package and would like to review the default configuration that shipped with this version. Which of the following files should the administrator review?
A. /etc/named.conf.rpmnew
B. /etc/named.conf.rpmsave
C. /etc/named.conf
D. /etc/bind/bind.conf
Show Answer
Correct Answer:
A. /etc/named.conf.rpmnew
Question 9
A Linux administrator would like to use systemd to schedule a job to run every two hours. The administrator creates timer and service definitions and restarts the server to load these new configurations. After the restart, the administrator checks the log file and notices that the job is only running daily. Which of the following is MOST likely causing the issue?
A. The checkdiskspace.service is not running
B. The checkdiskspace.service needs to be enabled
C. The OnCalendar schedule is incorrect in the timer definition
D. The system-daemon services need to be reloaded
Show Answer
Correct Answer:
C. The OnCalendar schedule is incorrect in the timer definition
Question 10
A Linux administrator needs to analyze a failing application that is running inside a container. Which of the following commands allows the Linux administrator to enter the running container and analyze the logs that are stored inside?
A. docker run -ti app /bin/sh
B. podman exec -ti app /bin/sh
C. podman run -d app /bin/bash
D. docker exec -d app /bin/bash
Show Answer
Correct Answer:
B. podman exec -ti app /bin/sh
Question 11
A systems administrator has been tasked with disabling the nginx service from the environment to prevent it from being automatically and manually started. Which of the following commands will accomplish this task?
A. systemctl cancel nginx
B. systemctl disable nginx
C. systemctl mask nginx
D. systemctl stop nginx
Show Answer
Correct Answer:
C. systemctl mask nginx
Question 12
A systems administrator created a web server for the company and is required to add a tag for the API so end users can connect. Which of the following would the administrator do to complete this requirement?
A. hostnamectl status --no-ask-password
B. hostnamectl set-hostname "$(perl -le "print" "A" x 86)"
A Linux administrator needs to determine if prerequisites are met. One of the application requirements is to install Perl on a system. Which of the following commands would accomplish this task?
A. rpm –Uf perl
B. rpm –iv perl
C. rpm –qa perl
D. rpm –eh perl
Show Answer
Correct Answer:
B. rpm –iv perl
Question 14
A systems administrator needs to integrate a new storage array into the company's existing storage pool. The administrator wants to ensure that the server is able to detect the new storage array. Which of the following commands should the administrator use to ensure that the new storage array is presented to the systems?
A. lsscsi
B. lsusb
C. lsipc
D. lshw
Show Answer
Correct Answer:
A. lsscsi
Question 15
A systems administrator is working on a security report from the Linux servers. Which of the following commands can the administrator use to display all the firewall rules applied to the Linux servers? (Choose two.)
A. ufw limit
B. iptables -F
C. systemctl status firewalld
D. firewall-cmd --list-all
E. ufw status
F. iptables -A
Show Answer
Correct Answer:
D. firewall-cmd --list-all
E. ufw status
Question 16
A systems administrator is notified that the mysqld process stopped unexpectedly. The systems administrator issues the following command: sudo grep –i -r ‘out of memory’ /var/log The output of the command shows the following: kernel: Out of memory: Kill process 9112 (mysqld) score 511 or sacrifice child. Which of the following commands should the systems administrator execute NEXT to troubleshoot this issue? (Select two).
A. free -h
B. nc -v 127.0.0.1 3306
C. renice -15 $( pidof mysql )
D. lsblk
E. killall -15
F. vmstat -a 1 4
Show Answer
Correct Answer:
A. free -h
F. vmstat -a 1 4
Question 17
After connecting to a remote host via SSH, an administrator attempts to run an application but receives the following error: [user@worksration ~]$ ssh admin@srv1 Last login: Tue Mar 29 18:03:34 2022 [admin@srv1 ~] $ /usr/local/bin/config_manager Error: cannot open display: [admin@srv1 ~] $ Which of the following should the administrator do to resolve this error?
A. Disconnect from the SSH session and reconnect using the ssh -x command
B. Add Options X11 to the /home/admin/ .ssh/authorized_keys file
C. Open port 6000 on the workstation and restart the firewalld service
D. Enable X11 forwarding in /etc/ssh/ssh_config and restart the server
Show Answer
Correct Answer:
D. Enable X11 forwarding in /etc/ssh/ssh_config and restart the server
Question 18
A Linux administrator is alerted to a storage capacity issue on a server without a specific mount point or directory. Which of the following commands would be MOST helpful for troubleshooting? (Choose two.)
A. parted
B. df
C. mount
D. du
E. fdisk
F. dd
G. ls
Show Answer
Correct Answer:
B. df
D. du
Question 19
The systemd logs are disappearing after a restart, even though the free disk space is adequate. Which of the following is the cause of this behavior?
A. The option Storage=volatile is set in the journald configuration
B. The journald size limit has been exceeded
C. The service systemd-journald is disabled and masked
D. The directory /tmp does not have enough free space
Show Answer
Correct Answer:
C. The service systemd-journald is disabled and masked
Question 20
A systems administrator is tasked with creating an Ansible playbook to automate the installation of patches on several Linux systems. In which of the following languages should the playbook be written?
A. SQL
B. YAML
C. HTML
D. JSON
Show Answer
Correct Answer:
B. YAML
Aced these? Get the Full Exam
Download the complete XK0-005 study bundle with 222+ questions in a single printable PDF.