journalctl command
Read systemd logs for services and the system.
- Processes & services
- Package systemd
- 9 options · 8 examples
Syntax
journalctl [options]Provided by the systemd package. Run man journalctl for the full manual.
Common options
| Option | What it does |
|---|---|
-u UNIT | Logs of one service |
-f | Follow new entries |
-n N | Last N lines |
-b | Since the last boot (-b -1 = previous boot) |
--since / --until | Time range, e.g. "1 hour ago" |
-p LEVEL | Priority, e.g. err |
-k | Kernel messages |
--disk-usage | Space used by the journal |
--vacuum-size=SIZE | Shrink the journal |
Examples
Logs of a service
journalctl -u nginxFollow a service live
journalctl -u nginx -fLast 100 lines
journalctl -u ssh -n 100Since the last boot
journalctl -bErrors only
journalctl -p err -bLast hour
journalctl --since "1 hour ago"Kernel messages
journalctl -kShrink the journal to 500 MB
sudo journalctl --vacuum-size=500M
No example matches. Check the options table or search the guides.
journalctl guides
- How to Automate Journalctl Log Cleanup on Linux Linux · Updated Apr 2025
