How to make journalctl faster?

On Linux, I check system logs by journalctl. But it is soooo slow. How to make it faster.

By default without any options, the journalctl is indeed very slow. But usually, we are only interested in some logs and can use options to specify the logs that we are interested to check. This will make journalctl less slower.

Check the last 100 lines

journalctl -n 100

It will show the most recent 100 journal events.

Check since last boot

journalctl -b -0

Here, -0 is the last boot, -1 the boot before last, and so on.

For more usages of the command, check journalctl manual.

Answered by Eric Z Ma.

Eric Z Ma

Eric is a father and systems guy. Eric is interested in building high-performance and scalable distributed systems and related technologies. The views or opinions expressed here are solely Eric's own and do not necessarily represent those of any third parties.

Leave a Reply

Your email address will not be published. Required fields are marked *