Multiple choice technology

How do you print the first 15 lines of all files ending by ".txt"?

  1. print 15 .txt

  2. cat *.txt -length=15

  3. head -15 *.txt

  4. type 15 .txt

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

The head command displays the first N lines of files. 'head -15 *.txt' shows the first 15 lines of all files ending in .txt (the *.txt pattern matches all such filenames). Options B, C, and D use incorrect commands or syntax.