CompTIA Linux+ Sample Questions for XK0-005 Exam Preparation
- CertiMaan
- Oct 26
- 7 min read
Ace the CompTIA Linux+ XK0-005 exam with these updated and expert-curated sample questions tailored to match the latest exam format. These CompTIA Linux+ practice questions cover essential domains such as system management, security, scripting, automation, and troubleshooting—helping IT professionals prepare thoroughly for real-world Linux environments. Whether you're searching for free CompTIA Linux+ practice exams, XK0-005 dumps, or simulated mock tests, these sample questions are a valuable asset for exam readiness. Designed for system administrators and Linux enthusiasts aiming for certification, this collection helps reinforce core Linux concepts and boosts exam confidence. Begin your Linux+ journey with focused resources aligned to CompTIA’s certification goals.
CompTIA Linux+ Sample Questions List :
1. A cloud engineer needs to check the link status of a network interface named eth1 in a Linux server. Which of the following commands can help to achieve the goal?
ifconfig hw eth1
ss -ti eth1
ip link show eth1
netstat -r eth1
2. A Linux administrator modified the SSH configuration file. Which of the following commands should be used to apply the configuration changes?
systemctl reload sshd
systemctl mask sshd
systemctl stop sshd
systemctl start sshd
3. A senior Linux administrator has created several scripts that will be used to install common system applications. These scripts are published to a repository to share with the systems team. A junior Linux administrator needs to retrieve the scripts and make them available on a local workstation. Which of the following Git commands should the junior Linux administrator use to accomplish this task?
fetch
checkout
clone
branch
4. A Linux administrator wants to find out whether files from the wget package have been altered since they were installed. Which of the following commands will provide the correct information?
rpm -F wget
rpm -V wget
rpm -qf wget
rpm -i wget
5. A Linux administrator is configuring Apache on a system and needs to allow the service to start after every startup. Which of the following commands will allow the Linux administrator to accomplish this task while starting the service at the same time?
systemctl start —-runtime boot httpd
systemctl set-property restart httpd
systemctl enable --now httpd
systemctl mask --state=active httpd
6. An administrator needs to make some changes in the IaC declaration templates. Which of the following commands would maintain version control?
git clone https://qithub.com/comptia/linux+-.git git fetch New-Branch
git clone https://github.com/comptia/linux+-.git git status
git clone https://github.com/comptia/linux+-.git git push origin
git clone https://github.com/comptia/linuxt+-.git git checkout -b <new-branch>
7. A Linux administrator needs to expose port 9000 for a container to listen during runtime. The Linux administrator creates a Dockerfile with the following entries. # Test-Container FROM node:9-alpine - WORDDIR /usr/src/app - COPY package*.json ./ RUN npm install - copy . . EXPOSE 9000 - CMD ['npm", "start"] Which of the following commands should the administrator use to accomplish this task? (Choose two).
docker push Test-Container
docker tag Test-Container
docker build -t Test-Container
docker inspect Test-Container
docker run -p 9000:80 Test-Container
docker run -p 80:9000 Test-Container
8. 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-----?
0038
0027
0640
0017
9. Which of the following concepts describes the approach of keeping all configurations in a repository?
Agentless deployment
Infrastructure as code
Orchestration
Inventory
10. Which of the following best describes YAML?
An open-source container orchestration engine
A package used to start a cloud instance
An open-source configuration management tool
A data serialization language that is widely used in writing configuration files
11. A Linux administrator is removing non-permanent rules from the system firewall. Which of the following commands will allow the administrator to achieve this goal in the safest way possible?
firewall-cmd –-runtime-to-permanent
firewall-cmd –-complete-reload
firewall-cmd –-set-default-zone
firewall-cmd –-reload
12. A systems administrator needs to determine the largest file in a given directory. Which of the following commands should the administrator use?
df /home/CFO
ls /home/CFO
du /home/CFO
stat /home/CFO
13. 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?
.ssh
.gitignore
get
Clone
14. A Linux administrator needs to schedule a system backup script /usr/local/bin/backup.sh to run every night at 1:30 a.m. Which of the following entries should the administrator add to system crontab to achieve the goal?
30 1 * /usr/local/bin/backup.sh
* 1 30 /usr/local/bin/backup.sh
1:30 * /usr/local/bin/backup.sh
1 30 * /usr/local/bin/backup.sh
15. A systems administrator wants to test the route between IP address 10.0.2.15 and IP address 192.168.1.40. Which of the following commands will accomplish this task?
ip route get 192.163.1.40 from 10.0.2.15
route -n 192.168.1.40 from 10.0.2.15
route -e get to 192.168.1.40 from 10.0.2.15
ip route 192.169.1.40 to 10.0.2.15
16. A Linux system is failing to start due to issues with several critical system processes. Which of the following options can be used to boot the system into the single user mode? (Choose two.)
Interrupt the boot process in the GRUB menu and add systemd.unit=single in the kernel line
Execute the following command from the GRUB rescue shell: mount -o remount, ro/sysroot
Interrupt the boot process in the GRUB menu and add systemd.unit=rescue.target in the kernel line
Interrupt the boot process in the GRUB menu and add systemd.unit=single.target in the kernel line
Interrupt the boot process in the GRUB menu and add init=/bin/bash in the kernel line
Interrupt the boot process in the GRUB menu and add single=user in the kernel line
17. In order to copy data from another VLAN, a systems administrator wants to temporarily assign IP address 10.0.6.5/24 to the newly added network interface enpls0f1. Which of the following commands should the administrator run to achieve the goal?
ifconfig 10.0.6.5/24 enpsls0f1
echo "IPV4_ADDRESS=10.0.6.5/24" > /etc/sysconfig/network-scripts/ifcfg-enpls0f1
ip addr add 10.0.6.5/24 dev enpls0f1
nmcli conn add ipv4.address=10.0.6.5/24 if name snpls0f1
18. A cloud engineer needs to block the IP address 192.168.10.50 from accessing a Linux server. Which of the following commands will achieve this goal?
iptables -A INPUT -s 192.168.10.30 -j DROP
iptables -F INPUT -j 192.168.10.50 -m DROP
iptables -j INPUT 192.168.10.50 -p DROP
iptables -i INPUT --ipv4 192.168.10.50 -z DROP
19. Using AD Query, the security gateway connections to the Active Directory Domain Controllers using what protocol?
Hypertext Transfer Protocol Secure (HTTPS)
Windows Management Instrumentation (WMI)
Remote Desktop Protocol (RDP)
Lightweight Directory Access Protocol (LDAP)
20. Developers have requested implementation of a persistent, static route on the application server. Packets sent over the interface eth0 to 10.0.213.5/32 should be routed via 10.0.5.1. Which of the following commands should the administrator run to achieve this goal?
echo "10.0.213.5 10.0.5.1 eth0" > /proc/net/route
ip route add 10.0.213.5/32 via 10.0.5.1 dev eth0
route modify eth0 +ipv4.routes "10.0.213.5/32 10.0.5.1"
route -i etho -p add 10.0.213.5 10.0.5.1
21. A systems administrator is building a database container. The container should perform different tasks based on the parameters that are provided during startup (for example, init, start, recover). The administrator wrote a startScript.sh script to achieve this objective. Which of the following Dockerfile statements would run the startScript.sh using the provided parameters?
ENTRYPOINT /startScript.sh
RUN /startScript.sh
EXPOSE /startScript.sh
CMD /startScript.sh
22. A Linux administrator is troubleshooting an issue in which users are not able to access https://portal.comptia.org from a specific workstation. The administrator runs a few commands and receives the following output: # cat /etc/hosts 10.10.10.55 portal.comptia.org # host portal.comptia.org portal.comptia.org has address 192.168.1.55 #cat /etc/resolv.conf nameserver 10.10.10.5 Which of the following tasks should the administrator perform to resolve this issue?
Add a network route from the 10.10.10.0/24 to the 192.168.0.0/16.
Remove the entry for portal.comptia.org from the local hosts file
Clear the local DNS cache on the workstation and rerun the host command
Update the name server in resolv.conf to use an external DNS server
23. A Linux administrator is configuring network traffic forwarding. Despite having proper iptables rules, the traffic forwarding is not working. Which of the following commands will allow Linux to pass network traffic between different interfaces?
ip route forward allow --all-interfaces ; systemctl restart network
modprobe ip_forward
echo 'net.ipv4.ip_forward=1' >> /etc/sysctl.conf ; sysctl -p
nmcli allow-forwarding eth0
24. An administrator started a long-running process in the foreground that needs to continue without interruption. Which of the following keystrokes should the administrator use to continue running the process in the background?
bg
jobs -1
bg
bg &
25. A systems administrator is analyzing the data usage on a Linux system. Which of the following commands will display a list of the entire /var contents along with sizes?
lsblk /var
du –ah /var/
ls –ltr /var | sort –n
df –h /var
FAQs
1. What is the CompTIA Linux+ XK0-005 certification exam?
It is a globally recognized certification that validates the skills needed to administer, configure, and troubleshoot Linux systems across various environments.
2. How do I become CompTIA Linux+ XK0-005 certified?
You must register for and pass the XK0-005 exam, which tests your practical and technical Linux knowledge.
3. What are the prerequisites for the CompTIA Linux+ XK0-005 exam?
There are no official prerequisites, but CompTIA recommends CompTIA A+ and Network+ certifications or equivalent Linux experience.
4. How much does the CompTIA Linux+ XK0-005 certification cost?
The exam costs $358 USD, though prices may vary by location.
5. How many questions are in the CompTIA Linux+ XK0-005 exam?
The exam includes 90 questions, a mix of multiple-choice and performance-based tasks.
6. What topics are covered in the CompTIA Linux+ XK0-005 exam?
It covers system management, security, scripting, automation, networking, and troubleshooting.
7. How difficult is the CompTIA Linux+ XK0-005 certification exam?
It’s considered moderately challenging and requires hands-on Linux experience and command-line proficiency.
8. How long does it take to prepare for the CompTIA Linux+ XK0-005 exam?
Most candidates prepare for 8–12 weeks, depending on experience and study schedule.
9. What jobs can I get after earning the CompTIA Linux+ XK0-005 certification?
You can work as a Linux Administrator, Systems Engineer, IT Support Specialist, or Network Administrator.
10. How much salary can I earn with a CompTIA Linux+ XK0-005 certification?
Professionals with this certification typically earn between $75,000–$100,000 annually, depending on experience and role.

Comments