Flag | Effect |
---|---|
-b | current boot |
-b -2 | second to last boot |
-e | jump to end |
-x | descriptions |
You don't typically clear the journal yourself. That is managed by systemd itself and old logs are rotated out as new data comes in. Vacuuming removes archived journal files, not active ones. To get rid of everything, you need to rotate the files first so that recent entries are moved to inactive files.
journalctl --rotate journalctl --vacuum-time=1s
(you cannot combine this into one journalctl command.)
Some distributions have journald configured so that it writes logs to /var/log/journal
while others keep logs in memory (/run/log/journal
). In some cases it may be necessary to use journalctl –flush
first to get everything removed.
You have to persist the journal for it to be available across reboots, else it'd just be stored in volatile storage, i.e. memory.
mkdir -p /var/log/journal systemd-tmpfiles --create --prefix /var/log/journal # reload journald service configuration killall -USR1 systemd-journald
(source)