XK0-006 System Management Practice Question
An administrator needs to view the last 20 lines of the systemd journal for the 'sshd' service. Which command should be used?
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 the last 20 lines of the journal for the sshd 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 sshd | tail -20
Why it's wrong here
systemctl status shows a limited log, but not the full journal.
- ✓
journalctl -u sshd -n 20
Why this is correct
Correct: -u specifies unit, -n limits lines to 20.
- ✗
journalctl -u sshd --since '1 hour ago'
Why it's wrong here
Shows entries since 1 hour ago, not last 20 lines.
- ✗
journalctl -u sshd -f
Why it's wrong here
-f follows new entries, does not limit to last 20.
Go deeper
Related to this question
Learn chapter
File Transfer and Remote Access
Key term
Service
A service is a software component or system that performs a specific function and is available to be used by other programs or users over a network.
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.
About these practice questions
Courseiva writes every XK0-006 question from scratch — 979 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.