Categories: How ToServers

Clear Systemd Journal Logs in Ubuntu 20.04 and above

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

  • Active journal files will be marked as archived, so that they are never written to in future.
sudo journalctl --rotate

Delete journal logs older than 5 days:

sudo journalctl --vacuum-time=5days

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

ferisetyawanmyid

Share
Published by
ferisetyawanmyid

Recent Posts

Best SSH Clients for Linux: Top Tools for Secure Remote Connections

If you manage Linux servers regularly, you know how important SSH (Secure Shell) is. Whether…

6 days ago

🐧 Best Linux Distributions for Beginners and Daily Use (2025 Edition)

If you’re new to Linux or thinking about switching from Windows or macOS, this guide…

1 week ago

Essential SRE Tools That Run on Linux

Introduction Site Reliability Engineering (SRE) has become a critical discipline in modern IT operations. The…

4 weeks ago

Best Free CRM Websites for Businesses in 2025

Updated: August 17, 2025 A practical guide to the best free CRM (Customer Relationship Management)…

2 months ago

Free Website Hosting Control Panel for Linux

If you run a VPS or dedicated server with Linux, you probably know that managing…

2 months ago

How to Find Out Who Rebooted Your Ubuntu Server (Step-by-Step Guide)

Short summary: Use built-in Linux tools (`who`, `last`, `journalctl`, `/var/log/auth.log`) and optional audit logs to…

2 months ago

This website uses cookies.