XK0-006 Troubleshooting Practice Question
A Linux administrator is troubleshooting a service that fails to start. Which TWO commands can be used to view the last 20 lines of the systemd journal for the sshd 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 sshd -n 20
journalctl -u sshd -n 20 shows last 20 lines for the unit. journalctl -u sshd | tail -20 also works. The others use wrong options or units.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✓
journalctl -u sshd -n 20
Why this is correct
Correct: -u for unit, -n for number of lines.
- ✓
journalctl -u sshd | tail -20
Why this is correct
Correct: uses tail to get last 20 lines.
- ✗
journalctl -k -n 20
Why it's wrong here
-k shows kernel messages, not sshd.
- ✗
journalctl -u sshd -p err
Why it's wrong here
-p err filters by priority, not last 20 lines.
- ✗
journalctl -b -u sshd
Why it's wrong here
Shows all messages from current boot, not last 20.
Go deeper
Related to this question
Learn chapter
Linux Fundamentals and History
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
This XK0-006 question is part of Courseiva's 979-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam 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.