Bird
0
0

You want to monitor live logs from the docker.service as they happen. Which command should you use?

hard📝 Application Q15 of 15
Linux CLI - System Administration
You want to monitor live logs from the docker.service as they happen. Which command should you use?
Ajournalctl -u docker.service --since now
Bjournalctl -u docker.service -f
Cjournalctl -u docker.service -n 0
Djournalctl -u docker.service --no-pager
Step-by-Step Solution
Solution:
  1. Step 1: Identify option for live log streaming

    The -f option in journalctl streams new log entries live, similar to tail -f.
  2. Step 2: Evaluate other options

    journalctl -u docker.service --since now shows logs since now but does not follow live updates. journalctl -u docker.service -n 0 shows zero lines, so no output. journalctl -u docker.service --no-pager disables paging but does not stream live.
  3. Final Answer:

    journalctl -u docker.service -f -> Option B
  4. Quick Check:

    -f = follow live logs [OK]
Quick Trick: Use -f to follow logs live like tail -f [OK]
Common Mistakes:
  • Using --since now without -f for live updates
  • Using -n 0 which shows no lines
  • Confusing --no-pager with live streaming

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Linux CLI Quizzes