Bird
0
0

After running tail -f /var/log/app.log, you add a new log entry to app.log. What will tail display?

medium📝 Command Output Q4 of 15
Linux CLI - Viewing and Editing Files
After running tail -f /var/log/app.log, you add a new log entry to app.log. What will tail display?
AIt will restart and show the entire file from the beginning.
BIt will immediately show the new log entry appended to the file.
CIt will stop displaying output until restarted.
DIt will show an error indicating the file changed.
Step-by-Step Solution
Solution:
  1. Step 1: Understand tail -f behavior

    The -f option keeps the file open and watches for new lines.
  2. Step 2: Adding new lines

    When a new line is appended, tail -f immediately outputs it to the terminal.
  3. Final Answer:

    It will immediately show the new log entry appended to the file. -> Option B
  4. Quick Check:

    Does tail -f show appended lines live? Yes [OK]
Quick Trick: tail -f outputs new appended lines live [OK]
Common Mistakes:
MISTAKES
  • Expecting tail to restart or reload the entire file
  • Assuming tail stops after initial output
  • Thinking tail shows errors on file changes

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Linux CLI Quizzes