brewedbits.dev

Personal blog with guides and news on selfhosting, Linux and AI, from the Netherlands

nextDash nextdash --aboutYour bookmarks. Your terminal. checks your links knows your Docker host one container, no cloudLive demo →nextdash.cc ↗

Tip: journalctl -r puts the newest entries on top

Journalctl
~/tips/tip-journalctl-reverse-newest-first

journalctl -r -u ssh

Reverses the order so the newest journal entry is shown first.

I read logs from the bad news backwards, so I want the latest line first.

-r reverses the output. With a pager the newest entry is at the top and you scroll back in time, which saves the jump to the end. It combines with every filter, so -r -u ssh shows the most recent SSH activity first.

journalctl -r -u ssh

In follow mode the flag does nothing useful, because new lines always arrive at the bottom. Use it for looking back and not for watching.

Further reading: journalctl(1) manual page

More Journalctl tips journalctl -k -g 'killed process' --since "2 days ago" journalctl _PID=1 -b ls -lh /var/log/journal/*/*.journal~ Storage=volatile sudo journalctl --setup-keys All Journalctl tips (81) All topics

Link