Search messages with a regex
PCRE2 match on the MESSAGE field. Add -p err to cut the noise. Note: this is a full scan, not an index lookup
journalctl --grep='oom|out of memory' --case-sensitive=false -b
- tool
- journalctl12 commands
More journalctl commands
-
journalctl -u <name> -o verbose -n 1Print every journal field of the latest entry, including the cursor. Use -o json-pretty for scripts
-
journalctl --list-boots && journalctl -b -1 -p warningList past boots, then -b -1 reads the previous boot. Note: this needs persistent journal storage
-
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=2dShow the disk usage, then shrink the journal to 500M and delete entries older than 2 days
-
journalctl -t kernel -t sudo -f --no-hostnameFollow by SYSLOG_IDENTIFIER, not by unit. -t can be repeated, --no-hostname removes clutter