Courseiva
Essential CommandsmediumMultiple SelectObjective-mapped

LFCS Essential Commands Practice Question

Which TWO commands can be used to view the last 10 lines of a file and also follow new lines as they are written?

⚠ Common exam trap

Linux Foundation often tests the distinction between `tail -n 10` (static view) and `tail -f -n 10` (dynamic follow), and candidates may overlook the `-f` flag or confuse `head` with `tail`.

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 -n 10

`tail -f -n 10` displays the last 10 lines of a file and then follows new lines as they are appended, using the `-f` (follow) flag. This is the standard way to monitor a log file in real time while initially showing the most recent 10 lines.

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 -n 10

    Why this is correct

    Shows last 10 lines and follows.

  • cat -n

    Why it's wrong here

    Shows entire file with line numbers.

  • tail -n 10

    Why it's wrong here

    Shows last 10 lines but does not follow.

  • head -n 10

    Why it's wrong here

    Shows first 10 lines.

  • less +F

    Why this is correct

    Opens in follow mode like tail -f.

About these practice questions

One of 507 original LFCS 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 LFCS practice question is part of Courseiva's free Linux Foundation 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 LFCS exam.