Multiple choice technology operating systems

You need to see the last fifteen lines of the files dog, cat and horse. What command should you use?

  1. head -n 15 dog cat horse

  2. tail -15 dog cat horse

  3. tail -n 15 dog cat horse

  4. head -15 dog cat horse

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

The tail command displays the last lines of a file. Using tail -n 15 dog cat horse will show the last 15 lines of all three files (dog, cat, and horse). The head command shows the beginning of files, not the end. While tail -15 works as an older syntax, tail -n 15 is the more explicit and preferred form.