Bird
0
0

Which command will correctly monitor the file /var/log/nginx/access.log live?

easy📝 Conceptual Q2 of 15
Linux CLI - Viewing and Editing Files
Which command will correctly monitor the file /var/log/nginx/access.log live?
Atail /var/log/nginx/access.log -f
Btail -f /var/log/nginx/access.log
Ctail -n 10 /var/log/nginx/access.log
Dtail -r /var/log/nginx/access.log
Step-by-Step Solution
Solution:
  1. Step 1: Identify correct syntax for tail -f

    The option -f must come immediately after tail followed by the filename.
  2. Step 2: Check other options

    tail -n 10 shows last 10 lines once, tail -r reverses output, and tail /file -f is invalid syntax.
  3. Final Answer:

    tail -f /var/log/nginx/access.log -> Option B
  4. Quick Check:

    Correct tail -f syntax = tail -f /var/log/nginx/access.log [OK]
Quick Trick: Options come before filename in Linux commands [OK]
Common Mistakes:
MISTAKES
  • Placing options after filename
  • Using -r instead of -f
  • Using -n without -f for live monitoring

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Linux CLI Quizzes