Multiple choice technology operating systems

You need to see the last fifteen lines of a file. What command should you use?

  1. tail -15 filename

  2. head -15 filename

  3. zcat -15 filename

  4. All of the above

  5. None of the above

Reveal answer Fill a bubble to check yourself
A Correct answer
Explanation

The tail command displays the last lines of a file. tail -15 shows the last 15 lines. Conversely, head displays the beginning of a file. The -n option (default 10) specifies line count, so tail -15 filename is correct.

AI explanation

tail -15 filename prints the last 15 lines of a file, since tail by design shows the end of a file and the -N flag sets how many lines to display. head -15 would instead show the first 15 lines, and zcat is for viewing compressed files, not line counts.