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 -e loads only the last 1000 lines unless you ask for more

Journalctl
~/tips/tip-journalctl-e-more-lines

journalctl -u nginx -e -n 5000

Scroll further back after jumping to the end of the journalctl pager.

-e is great for jumping to the end of a log, but scrolling up stops long before the start of the day. That is by design.

The man page says -e implies -n1000, so the pager only ever gets the last thousand entries. Pass your own number to load more:

journalctl -u nginx -e -n 5000

With a tag that has 1500 lines, journalctl -t bulk -e hands 1000 lines to the pager and journalctl -t bulk -e -n 1400 hands over 1400. You still start at the bottom; there is just more history above you.

If you want the whole history and still start at the end, I find a time filter nicer than a guessed line count:

journalctl -u nginx -e --since today -n 100000

There is a second default hidden in -e: it also implies -b 0, so you only see the current boot. If the history you are after is from before the last reboot, add -b -1 or -b all yourself. And keep -n sensible; loading a huge journal into less takes time and memory.

Further reading: journalctl man 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