mrsn0.3.0
auth
live

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.

2026-11-232 min read

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.

last lines
100
-n 100 · default is 10
relative window
1 hour
--since "1 hour ago"
disk cap
500M
--vacuum-size · SystemMaxUse
the whole sheet
6
-u · -f · -n · --since · -p · -b
The crash you rebooted away is still in the journal.

How do you tail, filter and follow Linux logs with journalctl?

  1. -u — unit: journalctl -u nginx, or several with a second -u
  2. -f — follow: stream new entries, tail -f style, in a second terminal while you restart the service
  3. -n — lines: journalctl -n 100; add --no-pager or a pipe hangs on less
  4. --since — time: journalctl --since "1 hour ago"; forgiving windows beat exact timestamps
  5. -p — severity: journalctl -p err -b, errors only this boot
  6. -b — boot: journalctl -b -1 for 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:

emergalertcriterrwarningnoticeinfodebug

-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?

QuestionWhere to look
Application and service behaviourjournalctl — anything systemd manages, indexed and filterable; default first stop
Kernel and hardware: OOM kills, USB resets, disk errorsjournalctl -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.

The law: filter before you scroll. -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
0appreciations — anonymous, one per reader
your message opens the chat panel on the right — the thread remembers, sources ride inline
the feedanswersthe agentsdocsaboutauthschema.jsonopenapi.jsonllms.txt