0
0
Linux CLIscripting~5 mins

journalctl for systemd logs in Linux CLI - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
Recall & Review
beginner
What is journalctl used for in Linux?

journalctl is a command-line tool to view and manage systemd logs on Linux systems. It helps you read system and service logs stored by systemd's journal.

Click to reveal answer
beginner
How do you show the most recent logs using journalctl?

Use journalctl -r to display logs in reverse order, showing the newest entries first.

Click to reveal answer
beginner
How can you filter logs for a specific service, for example, ssh.service?

Use journalctl -u ssh.service to see logs only for the SSH service.

Click to reveal answer
beginner
What option shows live logs as they happen with journalctl?

Use journalctl -f to follow logs live, similar to tail -f.

Click to reveal answer
beginner
How do you limit journalctl output to logs from the current boot only?

Use journalctl -b to show logs from the current boot session.

Click to reveal answer
Which command shows the latest systemd logs first?
Ajournalctl -r
Bjournalctl -b
Cjournalctl -f
Djournalctl -u
How do you view logs only for the nginx.service?
Ajournalctl -f nginx.service
Bjournalctl -b nginx.service
Cjournalctl -u nginx.service
Djournalctl -r nginx.service
What does journalctl -f do?
AFilters logs by user
BShows logs from the last boot
CShows logs in reverse order
DFollows logs live as they are written
Which option limits logs to the current boot session?
A-b
B-u
C-r
D-f
If you want to see all logs without filtering, which command do you use?
Ajournalctl -u
Bjournalctl
Cjournalctl -f
Djournalctl -b
Explain how to use journalctl to check logs for a specific service and follow them live.
Think about filtering by service and watching logs as they update.
You got /3 concepts.
    Describe how to view only the logs from the current boot using journalctl and why this might be useful.
    Focus on isolating logs to the current system start.
    You got /3 concepts.