Courseiva
mediumMultiple ChoiceObjective-mapped

XK0-006 Practice Question: A system administrator notices that the httpd…

A system administrator notices that the httpd service fails to start. Which command should be used to view the most recent log entries for that specific service?

⚠ Common exam trap

Candidates often choose `systemctl status httpd` (Option A) because it shows recent logs by default, but they overlook that it only displays a truncated snippet (usually the last 10–20 lines) and is not the command for viewing the most recent or complete log entries for a specific service.

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 httpd

C is correct because `journalctl -u httpd` queries the systemd journal for log entries specifically associated with the httpd service unit. This command shows the most recent log messages for that service, including startup failures, error codes, and dependency issues, making it the direct and precise tool for troubleshooting a service that fails to start.

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 httpd

    Why it's wrong here

    Shows status and tail of logs, but not as comprehensive as journalctl for historical logs.

  • dmesg | grep httpd

    Why it's wrong here

    dmesg displays kernel ring buffer, not application logs.

  • journalctl -u httpd

    Why this is correct

    Displays journal entries for the httpd unit.

  • tail -f /var/log/messages

    Why it's wrong here

    Shows all messages, not filtered by service.

About these practice questions

One of 979 original XK0-006 practice questions on Courseiva, each with a full explanation and wrong-answer analysis — not exam dumps or protected exam content. 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.