Signup/Sign In
Ask Question
Not satisfied by the Answer? Still looking for a better solution?

How to clear journalctl

I couldn't find in google any safe way to clear systemd journal. Do anyone know any safe and reliable way to do so?

Let's say I was experimenting with something and my logs got cluttered with various error messages. Moreover I'm displaying my journal on my desktop by using Conky. I really don't want to see those errors as they remind me an awful day I was fixing this stuff, I want to feel like a fresh man after this horror. I think everyone will agree that this is a valid reason to clear the logs :P .
by

2 Answers

akshay1995
The self maintenance method is to vacuum the logs by size or time.

Retain only the past two days:

journalctl --vacuum-time=2d

Retain only the past 500 MB:

journalctl --vacuum-size=500M
sandhya6gczb
You can set this in /etc/systemd/journald.conf like so:

SystemMaxUse=100M

Login / Signup to Answer the Question.