CompTIA XK0-005 Practice Exams
Last updated on Nov 16,2026- Exam Code: XK0-005
- Exam Name: CompTIA Linux+ Exam
- Certification Provider: CompTIA
- Latest update: Nov 16,2026
A junior developer is unable to access an application server and receives the following output:

The systems administrator investigates the issue and receives the following output:

Which of the following commands will help unlock the account?
- A . Pam_tally2 –user=dev2 ―-quiet
- B . pam_ tally2 –user=dev2
- C . pam_tally2 -Cuser+dev2 ―-quiet
- D . pam_tally2 –user=dev2 ―-reset
A systems administrator checked out the code from the repository, created a new branch, made changes to the code, and then updated the main branch. The systems administrator wants to ensure that the Terraform state files do not appear in the main branch.
Which of following should the administrator use to meet this requirement?
- A . clone
- B . gitxgnore
- C . get
- D . .ssh
Which of the following directories is the mount point in a UEFI system?
- A . /sys/efi
- B . /boot/efi
- C . /efi
- D . /etc/efi
A Linux administrator needs to redirect all HTTP traffic temporarily to the new proxy server 192.0.2.25 on port 3128.
Which of the following commands will accomplish this task?
- A . iptables -t nat -D PREROUTING -p tcp –sport 80 -j DNAT – -to-destination 192.0.2.25:3128
- B . iptables -t nat -A PREROUTING -p top –dport 81 -j DNAT C-to-destination 192.0.2.25:3129
- C . iptables -t nat -I PREROUTING -p top –sport 80 -j DNAT C-to-destination 192.0.2.25:3129
- D . iptables -t nat -A PREROUTING -p tcp –dport 80 -j DNAT C-to-destination 192.0.2.25:3128
DRAG DROP
As a Systems Administrator, to reduce disk space, you were tasked to create a shell script that does the following:
Add relevant content to /tmp/script.sh, so that it finds and compresses rotated files in /var/log without recursion.
INSTRUCTIONS
Fill the blanks to build a script that performs the actual compression of rotated log files.
If at any time you would like to bring back the initial state of the simulation, please click the Reset All button.

A systems administrator is deploying three identical, cloud-based servers.
The administrator is using the following code to complete the task:

Which of the following technologies is the administrator using?
- A . Ansible
- B . Puppet
- C . Chef
- D . Terraform
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
A systems administrator wants to check for running containers.
Which of the following commands can be used to show this information?
- A . docker pull
- B . docker stats
- C . docker ps
- D . docker list
A senior Linux administrator has created several scripts that will be used to install common system applications. These scripts are published to a reposito-ry to share with the systems team. A junior Linux administrator needs to re-trieve the scripts and make them available on a local workstation.
Which of the following Git commands should the junior Linux administrator use to accom-plish this task?
- A . fetch
- B . checkout
- C . clone
- D . branch
An administrator attempts to rename a file on a server but receives the following error.
![]()
The administrator then runs a few commands and obtains the following output:

Which of the following commands should the administrator run NEXT to allow the file to be renamed by any user?
- A . chgrp reet files
- B . chacl -R 644 files
- C . chown users files
- D . chmod -t files
