Bird
0
0

Which command correctly displays the last 10 lines of the /var/log/syslog file?

easy📝 Syntax Q12 of 15
Linux CLI - System Administration
Which command correctly displays the last 10 lines of the /var/log/syslog file?
Atail /var/log/syslog
Bhead /var/log/syslog
Ccat /var/log/syslog | head
Dless /var/log/syslog
Step-by-Step Solution
Solution:
  1. Step 1: Recall command functions

    The tail command shows the last lines of a file; by default, it shows the last 10 lines.
  2. Step 2: Compare options

    head shows the first lines, cat | head also shows first lines, and less opens a pager for browsing but does not directly show last lines.
  3. Final Answer:

    tail /var/log/syslog -> Option A
  4. Quick Check:

    tail = last 10 lines [OK]
Quick Trick: Use tail to see last lines quickly [OK]
Common Mistakes:
  • Using head instead of tail for last lines
  • Confusing less with tail output
  • Piping cat to head for last lines

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Linux CLI Quizzes