jourtnalctl cheat sheet
Related: systemctl
Configuration
Is in /etc/systemd/journald.conf.
Environment Vars
$SYSTEMD_PAGER overwrites $PAGER. Setting this to “” or “cat”
is equivalent to passing --no-pager.
Show…
Show service-name log
journalctl --no-pager -u _service-name_
Show events since the last boot
journalctl -b
Show today events
journalctl --since=today
Show (follow) current events
journalctl -f
Show the Last 50 error-level logs
journalctl -p err -n 50
Log Size Control
Retain only the past two days:
journalctl --vacuum-time=2d
Retain only the past 500 MB:
journalctl --vacuum-size=500M
Explain the messages
Jump to the end, explain the messages:
journalctl -xe
Explain the messages from the very beginning:
journalctl -x --no-pager