Bird
0
0

Which of the following is the correct command to follow the last 20 lines of a log file app.log live?

easy📝 Syntax Q3 of 15
Linux CLI - Viewing and Editing Files
Which of the following is the correct command to follow the last 20 lines of a log file app.log live?
Atail -f -n 20 app.log
Btail -n 20 -f app.log
Ctail -20 -f app.log
Dtail -f app.log -n 20
Step-by-Step Solution
Solution:
  1. Step 1: Understand option order for tail

    Options can be combined but -n must specify number of lines, and -f to follow live.
  2. Step 2: Validate syntax correctness

    tail -n 20 -f app.log is correct; -20 is invalid; options after filename are wrong.
  3. Final Answer:

    tail -n 20 -f app.log -> Option B
  4. Quick Check:

    Correct combined options syntax = tail -n 20 -f app.log [OK]
Quick Trick: Use -n before -f for line count with follow [OK]
Common Mistakes:
MISTAKES
  • Using -20 instead of -n 20
  • Placing options after filename
  • Mixing option order incorrectly

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Linux CLI Quizzes