Courseiva
System ManagementmediumMultiple ChoiceObjective-mapped

XK0-006 System Management Practice Question

Which of the following commands will display the last 10 lines of a log file and also output new lines as they are appended?

⚠ Common exam trap

Watch out — candidates often confuse `tail -f` with `less +F` (which also works but uses a different syntax) or mistakenly think `head` can follow a file, but the exam expects precise knowledge of the `tail -f` command as the standard for real-time log viewing.

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

tail -f logfile

The `tail -f logfile` command displays the last 10 lines of the file by default and then continues to monitor the file for new lines, outputting them as they are appended. The `-f` (follow) option keeps the file open and polls for changes, making it the standard tool for real-time log monitoring.

Answer analysis

Option-by-option breakdown

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

  • head -f logfile

    Why it's wrong here

    head does not have a -f option.

  • less +F logfile

    Why it's wrong here

    less +F also follows, but it's not the default; the question asks for 'which of the following' and tail -f is the most standard.

  • tail -f logfile

    Why this is correct

    Correct: -f follows the file.

  • cat logfile

    Why it's wrong here

    cat displays the whole file once, does not follow.

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.