Bird
0
0

Why does journalctl -u myservice.service -n 5 -r show logs in reverse order?

hard📝 Conceptual Q10 of 15
Linux CLI - System Administration
Why does journalctl -u myservice.service -n 5 -r show logs in reverse order?
ABecause <code>-r</code> runs the command recursively
BBecause <code>-r</code> filters only recent logs
CBecause <code>-r</code> resets the journal log
DBecause <code>-r</code> reverses the output order to newest first
Step-by-Step Solution
Solution:
  1. Step 1: Understand the -r option

    The -r flag reverses the output order, showing newest logs first.
  2. Step 2: Apply to the command

    Combining -n 5 with -r shows last 5 logs starting from newest.
  3. Final Answer:

    -r reverses output order to newest first -> Option D
  4. Quick Check:

    -r = reverse output order [OK]
Quick Trick: Use -r to reverse log output order (newest first) [OK]
Common Mistakes:
  • Thinking -r filters logs
  • Assuming -r resets logs
  • Confusing -r with recursion

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Linux CLI Quizzes