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 -n +20 prints the oldest 20 entries instead of the newest

Journalctl
~/tips/tip-journalctl-oldest-lines-plus

journalctl -n +20

Shows the oldest journal entries, which tells you how far back the history goes.

Everyone knows -n for the newest lines. A plus sign turns it around.

A plain number after -n shows the most recent entries. A number with a leading plus shows the oldest ones. It is a quick way to see where the journal begins, for example to find out how far back the history reaches before you start to search.

journalctl -n +20

Combine it with --since if you want the first lines after a certain moment, because the oldest lines of the whole journal are often boot messages from long ago.

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