Free CompTIA Linux+ Troubleshooting Practice Test 2026 — XK0-005 Questions

This free CompTIA Linux+ Troubleshooting practice test covers diagnosing Linux storage, network, performance, boot, and authentication issues using dmesg, journalctl, top, htop, ss, and tcpdump. Each question includes a detailed explanation with Linux command-line context — perfect for XK0-005 exam prep.

Key Topics in CompTIA Linux+ Troubleshooting

6 Free CompTIA Linux+ Troubleshooting Practice Questions with Answers

Each question below includes 4 answer options, the correct answer, and a detailed explanation. These are real questions from the FlashGenius CompTIA Linux+ XK0-005 question bank for the Troubleshooting domain (12% of the exam).

Sample Question 1 — Troubleshooting

Which command would you use to check disk space usage on a Linux system when troubleshooting a full disk issue?

  1. A. df -h (Correct answer)
  2. B. du -sh
  3. C. ls -l
  4. D. fdisk -l

Correct answer: A

Explanation: The 'df -h' command displays the amount of disk space used and available on all mounted filesystems in a human-readable format. This is useful for identifying full disks. 'du -sh' summarizes disk usage for a directory, 'ls -l' lists directory contents, and 'fdisk -l' lists disk partitions.

Sample Question 2 — Troubleshooting

A user reports that their home directory is not accessible. Upon investigation, you find a permission issue. Which command can you use to reset the home directory permissions for the user 'john'?

  1. A. chmod 755 /home/john
  2. B. chown john:john /home/john (Correct answer)
  3. C. chmod 700 /home/john
  4. D. chown root:john /home/john

Correct answer: B

Explanation: The 'chown john:john /home/john' command sets the ownership of the home directory to the user 'john' and group 'john', which is typically required for proper access. 'chmod 755' and 'chmod 700' change permissions, not ownership. 'chown root:john' changes the owner to root, which is incorrect.

Sample Question 3 — Troubleshooting

You are unable to connect to a web service running in a Docker container on port 8080 from outside the host. What command can help you verify if the port is exposed correctly?

  1. A. docker ps
  2. B. docker inspect <container_id> (Correct answer)
  3. C. docker logs <container_id>
  4. D. docker exec -it <container_id> bash

Correct answer: B

Explanation: The 'docker inspect <container_id>' command provides detailed information about the container, including port bindings. This helps verify if the port 8080 is properly exposed. 'docker ps' lists running containers, 'docker logs' shows container logs, and 'docker exec' provides shell access to the container.

Sample Question 4 — Troubleshooting

After a recent update, a service fails to start. The logs indicate a missing library. Which command can help you find and install the missing library on a RHEL-based system?

  1. A. yum provides */libmissing.so (Correct answer)
  2. B. rpm -qf /lib/libmissing.so
  3. C. ldd /usr/bin/service
  4. D. yum search libmissing

Correct answer: A

Explanation: The 'yum provides */libmissing.so' command searches for packages that provide the 'libmissing.so' file, helping you to install the correct package. 'rpm -qf' finds the package owning an installed file, 'ldd' lists shared libraries for binaries, and 'yum search' searches package names and descriptions.

Sample Question 5 — Troubleshooting

A user complains that they cannot access a remote server via SSH. You suspect a firewall issue. Which command can you use to check if the necessary port is open on the server?

  1. A. netstat -tuln
  2. B. iptables -L
  3. C. ss -tuln
  4. D. firewall-cmd --list-all (Correct answer)

Correct answer: D

Explanation: The 'firewall-cmd --list-all' command shows the current firewall configuration, including open ports, on systems using firewalld. 'netstat -tuln' and 'ss -tuln' list listening ports but don't show firewall status. 'iptables -L' lists iptables rules but is less commonly used on systems with firewalld.

Sample Question 6 — Troubleshooting

You need to troubleshoot a kernel panic issue on a Linux server running in a cloud environment. Which log file is most likely to contain helpful information?

  1. A. /var/log/messages
  2. B. /var/log/secure
  3. C. /var/log/boot.log
  4. D. /var/log/dmesg (Correct answer)

Correct answer: D

Explanation: The '/var/log/dmesg' file contains kernel ring buffer messages, which include information about hardware and kernel events, including kernel panics. '/var/log/messages' contains general system logs, '/var/log/secure' logs security-related messages, and '/var/log/boot.log' contains boot process logs.

How to Study CompTIA Linux+ Troubleshooting

Combine these CompTIA Linux+ Troubleshooting practice questions with hands-on labs in a Linux VM (Ubuntu, Rocky, or Fedora). The XK0-005 exam emphasizes practical command-line work, so always test commands in a sandbox — that hands-on muscle memory is what separates passing and failing scores.

About the CompTIA Linux+ XK0-005 Exam

Other CompTIA Linux+ Domains

Start the free CompTIA Linux+ Troubleshooting practice test now | 10-question quick start | All CompTIA Linux+ domains | CompTIA Linux+ Cheat Sheet