Question 352 of 510
TroubleshootingmediumMultiple SelectObjective-mapped

Quick Answer

The answer is dmesg, journalctl, and the systemd journal itself, though the most direct and comprehensive method is journalctl. This is because systemd-based distributions use the journald service to collect and store binary log data, and journalctl is the dedicated command-line tool to query, filter, and view these logs in a structured format. On the CompTIA Linux+ XK0-005 exam, this topic tests your understanding of modern Linux logging architecture, often contrasting journalctl with older syslog-based tools like rsyslog or traditional text log files in /var/log. A common trap is assuming that only dmesg is valid for kernel messages, but dmesg actually reads from the kernel ring buffer, not the systemd journal, though it can be used alongside journalctl. For the exam, remember that journalctl is the primary method for viewing all system logs in systemd, while dmesg is specifically for kernel-related output. A helpful memory tip is "J for Journal, D for Dmesg" — think of journalctl as the full log library and dmesg as the kernel-only shelf.

XK0-005 Troubleshooting Practice Question

This XK0-005 practice question tests your understanding of troubleshooting. Read the scenario carefully and evaluate each option against the stated constraints before committing to an answer. After answering, compare your reasoning against the explanation and wrong-answer breakdown below. Once you have made your selection, read the full explanation to reinforce the concept and understand why each distractor is designed to mislead on exam day.

Which THREE are valid methods to view logs in a systemd-based system?

Question 1mediummulti select
Full question →

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

B is correct because `journalctl` is the primary command for querying the systemd journal, which is the default logging system on systemd-based distributions. It provides structured, binary logs with advanced filtering, and is the direct equivalent of viewing logs via the journal.

Key principle: Answer the scenario, not the keyword: identify the specific constraint before choosing the most familiar-sounding option.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • cat /var/log/messages

    Why it's wrong here

    This is a traditional syslog file, not directly part of systemd journal.

  • journalctl

    Why this is correct

    Displays the systemd journal.

    Related concept

    Read the scenario before looking for a memorised answer.

  • journalctl -u sshd

    Why this is correct

    Filters journal logs for the sshd unit.

    Related concept

    Read the scenario before looking for a memorised answer.

  • systemctl status sshd

    Why it's wrong here

    Shows recent logs but only a limited amount; not a full view.

  • dmesg

    Why this is correct

    Shows kernel ring buffer messages.

    Related concept

    Read the scenario before looking for a memorised answer.

Common exam traps

Common exam trap: answer the scenario, not the keyword

The trap here is that candidates confuse `systemctl status` (which shows a brief log snippet) with a full log viewing method, or they assume legacy syslog files like `/var/log/messages` are always present and authoritative on systemd-based systems.

Trap categories for this question

  • Command / output trap

    Shows recent logs but only a limited amount; not a full view.

Detailed technical explanation

How to think about this question

The systemd journal stores logs in a binary format under `/var/log/journal/` (or `/run/log/journal/` if persistent storage is disabled), which allows for structured metadata like priority, facility, and unit name. `journalctl` can filter by time range, priority, unit, and even by specific fields using `_PID=`, `_COMM=`, or `_SYSTEMD_UNIT=`, making it far more powerful than traditional text-based log files. In real-world troubleshooting, using `journalctl -u sshd -p err --since '1 hour ago'` can quickly isolate recent errors for the SSH daemon without parsing through unrelated messages.

KKey Concepts to Remember

  • Read the scenario before looking for a memorised answer.
  • Find the constraint that changes the correct option.
  • Eliminate answers that are true in general but not in this case.

TExam Day Tips

  • Watch for words such as best, first, most likely and least administrative effort.
  • Review why wrong options are wrong, not only why the correct option is correct.

Key takeaway

Answer the scenario, not the keyword: identify the specific constraint before choosing the most familiar-sounding option.

Real-world example

How this comes up in practice

A practitioner preparing for the XK0-005 exam encounters this exact type of scenario on the job. The correct answer here is not the most general option — it is the best answer for the specific constraint described. Answer the scenario, not the keyword: identify the specific constraint before choosing the most familiar-sounding option. Real exam questions reward reading the full scenario before eliminating options, because the constraint defines which answer fits.

What to study next

Got this wrong? Here's your next step.

Identify which exam domain this question belongs to, review the core concept, then practise similar questions from the same domain.

Related practice questions

Related XK0-005 practice-question pages

Use these pages to review the topic behind this question. This is how one missed question becomes focused revision.

Practice this exam

Start a free XK0-005 practice session

Short sessions build daily habit. Longer sessions build exam-day stamina. Try a timed session to simulate real conditions.

FAQ

Questions learners often ask

What does this XK0-005 question test?

Troubleshooting — This question tests Troubleshooting — Read the scenario before looking for a memorised answer..

What is the correct answer to this question?

The correct answer is: journalctl — B is correct because `journalctl` is the primary command for querying the systemd journal, which is the default logging system on systemd-based distributions. It provides structured, binary logs with advanced filtering, and is the direct equivalent of viewing logs via the journal.

What should I do if I get this XK0-005 question wrong?

Identify which exam domain this question belongs to, review the core concept, then practise similar questions from the same domain.

What is the key concept behind this question?

Read the scenario before looking for a memorised answer.

About these practice questions

Courseiva creates original exam-style practice questions with explanations and wrong-answer analysis. It does not publish real exam questions, exam dumps, or protected exam content. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

Last reviewed: Jun 25, 2026

Question Discussion

Share a tip, memory trick, or ask about the reasoning behind this question. Do not post real exam questions, leaked content, braindumps, or copyrighted exam material. Comments are moderated and may be removed without notice.

Loading comments…

Sign in to join the discussion.

This XK0-005 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-005 exam.