CompTIA Linux+ Practice Questions: Troubleshooting

17 free, exam-style CompTIA Linux+ (XK0-006) practice questions covering Troubleshooting, each with the correct answer and an explanation. Start a timed exam below, or scroll on to read through the questions.

🧠

Mini Exam

25 Questions · 50 minutes

Start Quiz 🚀
🏆

Mock Linux+ Exam

85 Questions · 165 minutes

Start Quiz 🚀
📅

Daily Quiz

10 Questions · 20 minutes

Start Quiz 🚀
🎯

Standard Practice

50 Questions · 100 minutes

Start Quiz 🚀

Troubleshooting practice questions

Answers and explanations are shown. Take the timed exam above to test yourself first.

Q1. What command shows kernel ring buffer messages?

  • A.dmesg✓ Correct
  • B.journalctl
  • C.syslog
  • D.kernlog
Explanation: dmesg displays boot-time and kernel-related messages. Learn more.

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

  • A.All system logs
  • B.Kernel messages
  • C.NGINX service logs✓ Correct
  • D.User login history
Explanation: -u filters logs by systemd unit (service). Learn more.

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

  • A.Trace system calls✓ Correct
  • B.Show process tree
  • C.Monitor network traffic
  • D.Profile CPU usage
Explanation: strace intercepts system calls made by a process. Learn more.

Q4. What does 'logger' command do?

  • A.Analyze logs
  • B.Write to syslog✓ Correct
  • C.Rotate logs
  • D.Encrypt logs
Explanation: logger adds entries to the system log. Learn more.

Q5. Which directory contains logrotate configurations?

  • A./etc/logrotate.d/✓ Correct
  • B./var/log/
  • C./usr/lib/logrotate/
  • D./etc/rsyslog.d/
Explanation: Custom logrotate configs go in /etc/logrotate.d/. Learn more.

Q6. Which directory contains kernel panic crash dumps?

  • A./var/crash✓ Correct
  • B./proc/kcore
  • C./var/log/kernel
  • D./sys/kernel/debug
Explanation: Kernel crash dumps stored in /var/crash by default. Learn more.

Q7. Which command shows open files by process?

  • A.lsof✓ Correct
  • B.fuser
  • C.ps aux
  • D.netstat
Explanation: lsof lists open files and their processes. Learn more.

Q8. Which directory contains systemd journal logs?

  • A./var/log/journal✓ Correct
  • B./run/log
  • C./etc/systemd/journal
  • D./tmp/journal
Explanation: Persistent journals stored in /var/log/journal/. Learn more.

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

  • A.List failed services
  • B.Show slowest-starting units✓ Correct
  • C.Check disk I/O stats
  • D.Analyze security vulnerabilities
Explanation: Identifies services impacting boot performance. Learn more.

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

  • A.Bypass log rotation schedules✓ Correct
  • B.Delete old logs
  • C.Create new log files
  • D.Encrypt rotated logs
Explanation: Forces rotation even if not scheduled. Learn more.

Q11. Which command shows kernel ring buffer messages?

  • A.dmesg
  • B.journalctl -k
  • C.cat /proc/kmsg
  • D.All of the above✓ Correct
Explanation: All access kernel messages through different interfaces. Learn more.

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

  • A.Count system calls✓ Correct
  • B.Continue after signals
  • C.Capture network traffic
  • D.Colorize output
Explanation: Summarizes system call statistics. Learn more.

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

  • A.tail -f✓ Correct
  • B.head -n 1
  • C.chmod +x
  • D.mkfs.ext4
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?

  • A.dmesg✓ Correct
  • B.uname -m only
  • C.whoami
  • D.groups
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?

  • A.journalctl -u service✓ Correct
  • B.systemctl reload-daemon only
  • C.ls -u service
  • D.grep -u service
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?

  • A.journalctl -f✓ Correct
  • B.dmesg -C
  • C.last -f
  • D.find -journal
Explanation: journalctl -f follows new journal entries as they arrive. Learn more.

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

  • A.journalctl -u sshd -b✓ Correct
  • B.dmesg -u sshd
  • C.lastlog -b sshd
  • D.systemctl cat sshd --logs
Explanation: journalctl -u filters by the sshd unit, and -b restricts output to the current boot. Learn more.

More CompTIA Linux+ practice topics

Keep studying CompTIA Linux+

Full CompTIA Linux+ practice exam · CompTIA Linux+ study guide · All CompTIA practice questions

Last updated