CompTIA Linux+ Practice Questions: Troubleshooting

17 free, exam-style CompTIA Linux+ (XK0-006) practice questions covering Troubleshooting. Each question shows the correct answer and a clear explanation. Ready for the real thing? Take the full timed quiz below.

🚀 Take the full CompTIA Linux+ quiz 📘 CompTIA Linux+ study guide

Q1. What command shows kernel ring buffer messages?

Explanation: dmesg displays boot-time and kernel-related messages. Learn more.

Q2. What does 'journalctl -u nginx' display?

Explanation: -u filters logs by systemd unit (service). Learn more.

Q3. What does 'strace -p <PID>' do?

Explanation: strace intercepts system calls made by a process. Learn more.

Q4. What does 'logger' command do?

Explanation: logger adds entries to the system log. Learn more.

Q5. Which directory contains logrotate configurations?

Explanation: Custom logrotate configs go in /etc/logrotate.d/. Learn more.

Q6. Which directory contains kernel panic crash dumps?

Explanation: Kernel crash dumps stored in /var/crash by default. Learn more.

Q7. Which command shows open files by process?

Explanation: lsof lists open files and their processes. Learn more.

Q8. Which directory contains systemd journal logs?

Explanation: Persistent journals stored in /var/log/journal/. Learn more.

Q9. What is the purpose of 'systemd-analyze blame'?

Explanation: Identifies services impacting boot performance. Learn more.

Q10. What is the purpose of 'logrotate --force'?

Explanation: Forces rotation even if not scheduled. Learn more.

Q11. Which command shows kernel ring buffer messages?

Explanation: All access kernel messages through different interfaces. Learn more.

Q12. What is the purpose of 'strace -c'?

Explanation: Summarizes system call statistics. Learn more.

Q13. Which command displays the last lines of a log file and can follow new entries?

Explanation: tail -f shows the end of a file and continues displaying new lines as they are written. Learn more.

Q14. Which command displays kernel messages from the boot and runtime ring buffer?

Explanation: dmesg prints messages from the kernel ring buffer, useful for hardware and driver troubleshooting. Learn more.

Q15. Which command displays logs for a specific systemd unit?

Explanation: journalctl -u filters logs for a named systemd unit. Learn more.

Q16. Which command follows the end of the system journal in real time?

Explanation: journalctl -f follows new journal entries as they arrive. Learn more.

Q17. Which command shows messages for sshd from the current boot?

Explanation: journalctl -u filters by the sshd unit, and -b restricts output to the current boot. Learn more.

More CompTIA Linux+ practice topics