journalctl in one page: tail, filter and follow Linux logs
journalctl -u <service> -f answers 'why is this service down'; add -n 100 for the last 100 lines. Filter: --since '1 hour ago', -p err -b, -b -1. Cap with --vacuum-size=500M and SystemMaxUse=500M.
journalctl tail, filter and follow: journalctl -u <service> -f answers "why is this service down" live; -n 100 adds the last 100 lines. systemd replaced /var/log text files with a binary, indexed journal managed by systemd-journald — journalctl is the only front door.
The crash you rebooted away is still in the journal.
How do you tail, filter and follow Linux logs with journalctl?
-u— unit:journalctl -u nginx, or several with a second-u-f— follow: stream new entries, tail -f style, in a second terminal while you restart the service-n— lines:journalctl -n 100; add--no-pageror a pipe hangs onless--since— time:journalctl --since "1 hour ago"; forgiving windows beat exact timestamps-p— severity:journalctl -p err -b, errors only this boot-b— boot:journalctl -b -1for the previous boot
journalctl -n 100 # last 100 lines of everythingjournalctl -u nginx -n 100 # last 100 lines from one unitjournalctl -u nginx -u redis # several units at oncejournalctl _SYSTEMD_UNIT=nginx.service # exact matchjournalctl -u ollama -f -n 50 # live, starting with the last 50 lines
Priority, boot and disk
The -p ladder, descending:
-p err is the workhorse; -p warning..alert takes a range. For "is anything actually failing?": journalctl -p err -b --since today.
journalctl -b -1 -u sshd # why SSH died last timejournalctl --list-boots # index of stored bootsjournalctl --disk-usagesudo journalctl --vacuum-size=500M # keep newest 500 MBsudo journalctl --vacuum-time=30d # keep newest 30 days
two traps: the pager and the volatile journal
Without --no-pager, journalctl opens less and a script, pipe or ssh one-liner hangs waiting for a keypress. On some minimal installs the journal is volatile — stored in /run, wiped on reboot — because /var/log/journal does not exist.
sudo mkdir -p /var/log/journal sudo systemd-tmpfiles --create --prefix /var/log/journal sudo systemctl restart systemd-journald
Permanent cap: SystemMaxUse=500M under [Journal] in /etc/systemd/journald.conf. Verify with ls /var/log/journal — boots accumulate instead of wiping.
Which log first?
| Question | Where to look |
|---|---|
| Application and service behaviour | journalctl — anything systemd manages, indexed and filterable; default first stop |
| Kernel and hardware: OOM kills, USB resets, disk errors | journalctl -k / dmesg — check the OOM killer before blaming the app |
| Apps with their own files (nginx access logs, PostgreSQL) | /var/log/<app>/ — startup errors usually still land in the journal |
Local AI counts too: a stalled ollama serve unit gives up its model-load failure to journalctl -u ollama -n 100.
-u for unit, -f to follow, -n for lines, --since for time, -p for severity, -b for boots — six flags cover nearly every log question a Linux box will ask.- systemd-journald · Ubuntu/Debian · Fedora · Arch — every command runs as-is
- first published 2026-09-02 · record refreshed 2026-10-04
- no fabricated output: commands are standard journalctl usage; pager hang and volatile journal are documented journald defaults