Linux Ubuntu 22.04 clean journal log files

Commands to clean Ubuntu journal logs

Using the terminal Check the disk usage of the log files in the system

journalctl --disk-usage

Archive the log files to lock this files from future writes

sudo journalctl --rotate

Delete the log files by one of the following commands

# Delete logs that are older than 5days
sudo journalctl --vacuum-time=5days
# Delete logs till to reach 500M disk usage only
sudo journalctl --vacuum-size=500M
# Delete 5 log files starting from the older
sudo journalctl --vacuum-files=5