Courseiva
mediumMultiple SelectObjective-mapped

XK0-006 Practice Question: Which TWO commands are used to view logs in a…

Which TWO commands are used to view logs in a systemd-based system? (Choose two.)

⚠ Common exam trap

Many exam-takers confuse `systemctl` (service management) with `journalctl` (log viewing) because both are systemd commands, and they may also mistakenly think `tail -f /var/log/messages` is universally available on modern systemd-based distributions.

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

dmesg

C is correct because `dmesg` reads the kernel ring buffer, which contains boot-time and hardware-related log messages, and is commonly used to view logs on systemd-based systems. D is correct because `journalctl` is the primary command for querying and viewing logs from systemd's journal (managed by `systemd-journald`), which is the default logging subsystem in systemd-based distributions.

Answer analysis

Option-by-option breakdown

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

  • tail -f /var/log/messages

    Why it's wrong here

    This shows traditional syslog file, but it is a file display command, not a systemd-native command.

  • syslog

    Why it's wrong here

    syslog is a daemon, not a command; the command would be logger or tailing syslog files.

  • dmesg

    Why this is correct

    dmesg shows kernel log messages.

  • journalctl

    Why this is correct

    journalctl is used to query the systemd journal.

  • systemctl

    Why it's wrong here

    systemctl manages services, not log viewing.

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 →

How Courseiva writes practice questions · Editorial policy

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.