Clear Systemd Journal Logs in Ubuntu 20.04
Systemd has its own logging system called the journal, and the log files are stored in /var/log/journal
.
Check current disk usage of journal files
sudo journalctl --disk-usage
Rotate journal files
Delete log files until the disk space taken falls below 200M:
sudo journalctl --vacuum-size=200M
Delete old logs and limit file number to 10:
sudo journalctl --vacuum-files=10
The configuration file is located at /etc/systemd/journald.conf
. After editing to your preference, reload systemd daemon using sudo systemctl daemon-reload