List boots and read the previous one

List past boots, then -b -1 reads the previous boot. Note: this needs persistent journal storage

journalctl --list-boots && journalctl -b -1 -p warning

tool
journalctl12 commands
tags
journalctlkerneltroubleshooting

More journalctl commands

  • journalctl -k -b -o short-precise --grep='segfault|I/O error'

    Like dmesg, but with real clock time and boot filtering. -k means _TRANSPORT=kernel

  • journalctl --disk-usage; journalctl --vacuum-size=500M --vacuum-time=2d

    Show the disk usage, then shrink the journal to 500M and delete entries older than 2 days

  • journalctl -t kernel -t sudo -f --no-hostname

    Follow by SYSLOG_IDENTIFIER, not by unit. -t can be repeated, --no-hostname removes clutter

  • journalctl -u <name> --output=json --output-fields=__REALTIME_TIMESTAMP,MESSAGE,_PID | jq -r '[.__REALTIME_TIMESTAMP,._PID,.MESSAGE]|@tsv'

    Keep only the needed JSON fields and print them as tab-separated columns. __REALTIME_TIMESTAMP is in microseconds

  • journalctl -D /mnt/crashed/var/log/journal -b -1 -p err

    Read journals from another root (rescue or forensics) without copying files

all 12 journalctl commands