Skip to content

journalctl

21 commands

Queries the systemd journal: logs by service, boot, time range, priority and more.

  • logs
  • systemd
  • incident response

Reading6

journalctl

The whole journal, oldest first, in a pager.

journalctl -r

Newest first.

Link
journalctl -f

Follows new entries live, like tail -f.

journalctl -n <n>

The last n entries.

Link
journalctl -e

Opens at the end of the journal.

Link
journalctl -x -e

Adds explanatory help text to entries where available.

Link

Filtering10

journalctl -u <unit>

Entries from one service.

Link
journalctl -u <unit> --since "<time>"

Time-limited; accepts “today”, “yesterday” or exact timestamps.

Link
journalctl --since "<start>" --until "<end>"

A specific window — the core of incident triage.

Link
journalctl -b

The current boot only. -b -1 is the previous boot.

journalctl --list-boots

Every recorded boot with its time range — shows unexpected reboots.

Link
journalctl -p err -b

Errors and worse since boot. Levels: emerg, alert, crit, err, warning, notice, info, debug.

Link
journalctl -k

Kernel messages, like dmesg.

Link
journalctl _UID=<uid>

Entries generated by a user.

Link
journalctl _COMM=<name>

Entries from one executable — here, every sudo use.

Link
journalctl -g "<regex>"

Greps message text (systemd 237+).

Link

Output and maintenance5

journalctl -o json-pretty -n 5

Structured output with every field — useful for shipping to a SIEM.

Link
journalctl -o short-iso

ISO 8601 timestamps.

Link
journalctl --disk-usage

How much space the journal uses.

sudo journalctl --vacuum-time=<age>

Deletes entries older than the given age.

Link
journalctl --verify

Checks journal files for corruption or tampering when sealing is enabled.

Link