XK0-006 System Management Practice Question
Which command is used to display the contents of the systemd journal for a specific unit?
Answer choices
Why each option matters
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
✓
journalctl -u
journalctl -u unitname displays logs for the specified systemd unit.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
systemctl status unit
Why it's wrong here
systemctl status shows the unit's current state, recent log lines and process information, not the full journal contents for that unit. It is tempting because it does surface some log output, and would be correct for checking whether a service is active, failed or enabled rather than reading its complete journal history.
- ✗
dmesg
Why it's wrong here
dmesg reads the kernel ring buffer, which holds boot and driver messages, not systemd journal entries tagged by unit. It is tempting because it displays log-like output, and would be correct for diagnosing hardware, kernel module or driver faults rather than querying a specific service's journal.
- ✗
journalctl -f
Why it's wrong here
journalctl -f follows the journal live, streaming new entries as they arrive, rather than displaying the existing contents for a specific unit. It is tempting because it is journalctl, and would be correct for real-time monitoring during troubleshooting, not for reading a unit's recorded history.
- ✓
journalctl -u
Why this is correct
Using `journalctl -u` filters the systemd journal by unit name, satisfying the requirement to display entries for one specific unit. The `-u` flag accepts a unit such as `sshd.service`, restricting output to that unit's messages rather than the entire journal.
Go deeper
Related to this question
Key term
systemd
systemd is a system and service manager for Linux operating systems that initializes and manages processes, services, and system resources after the kernel boots.
Key term
journalctl
Journalctl is a command-line tool used to view and query logs collected by the systemd journal, which stores system and application messages on Linux systems.
About these practice questions
Courseiva writes every XK0-006 question from scratch — 781 in total, each with an explanation and a wrong-answer breakdown. None are copied from real exams or dumps. Learn why practice questions differ from exam dumps →
JA
Written by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
This XK0-006 practice question is part of Courseiva's free CompTIA certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the XK0-006 exam.