journalctl commands
12 commands, each with a one-line explanation. Click a command to copy it, or its title for details.
Commands 12 shown
-
journalctl -p err -b --no-pagerOnly err/crit/alert/emerg from current boot; -p takes a range too (e.g. -p warning..err)
-
journalctl _SYSTEMD_UNIT=sshd.service --since todayTrusted unit match by indexed field, unlike -u which also pulls coredumps/PAM noise
-
journalctl _PID=1 + _COMM=sshd -o short-isoA bare + is a logical OR between match groups; same-field matches within a group are OR'd too
-
journalctl --grep='oom|out of memory' --case-sensitive=false -bPCRE2 match on MESSAGE; pair with -p err to narrow noise. note: scans, not indexed
-
journalctl -u <name> -o verbose -n 1Dumps every journal field incl. cursor for an entry; -o json-pretty for machine parsing
-
journalctl --list-boots && journalctl -b -1 -p warningIndex past boots, then -b -1 reads the prior boot. note: needs persistent storage
-
journalctl -k -b -o short-precise --grep='segfault|I/O error'Like dmesg but with real wall-clock and boot filtering; -k means _TRANSPORT=kernel
-
journalctl --disk-usage; journalctl --vacuum-size=500M --vacuum-time=2dShow on-disk size, then prune to 500M and drop entries older than 2 days
-
journalctl -t kernel -t sudo -f --no-hostnameTail by SYSLOG_IDENTIFIER (not unit); -t repeats, --no-hostname trims clutter
-
journalctl -u <name> --output=json --output-fields=__REALTIME_TIMESTAMP,MESSAGE,_PID | jq -r '[.__REALTIME_TIMESTAMP,._PID,.MESSAGE]|@tsv'Trim JSON to needed fields then tab-format; __REALTIME_TIMESTAMP is microseconds
-
journalctl -D /mnt/crashed/var/log/journal -b -1 -p errRead journals from another root (rescue/forensics) without copying files in
-
journalctl --header | grep -iE 'file|state'; ls -d /var/log/journal 2>/dev/null || echo volatileIf /var/log/journal is absent, logs are volatile and lost on reboot. fix: mkdir + systemd-tmpfiles
no commands match — try a different search