nerdexam
Linux_FoundationLinux_Foundation

LFCS · Question #854

LFCS Question #854: Real Exam Question with Answer & Explanation

The correct answer is D: tail -n 10 filename. The tail command is used to display the last lines of a file, and the -n option specifies the exact number of lines to output.

Submitted by haru.x· Apr 18, 2026Essential Commands

Question

Which of the following commands will print the last 10 lines of a text file to the standard output?

Options

  • Acat -n 10 filename
  • Bdump -n 10 filename
  • Chead -n 10 filename
  • Dtail -n 10 filename

Explanation

The tail command is used to display the last lines of a file, and the -n option specifies the exact number of lines to output.

Common mistakes.

  • A. The cat command concatenates and prints file content, and its -n option numbers all output lines, it does not limit the output to the last 10 lines.
  • B. The dump command is primarily used for filesystem backups, not for displaying specific portions of text files.
  • C. The head command outputs the first part of files, so head -n 10 filename would print the first 10 lines, not the last 10.

Concept tested. Linux tail command usage

Reference. https://man7.org/linux/man-pages/man1/tail.1.html

Topics

#tail command#file viewing#command line utilities#standard output

Community Discussion

No community discussion yet for this question.

Full LFCS PracticeBrowse All LFCS Questions