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 -f -n 0 follows a log and prints only what arrives from now on

Journalctl
~/tips/tip-journalctl-follow-only-new-lines

journalctl -u docker -f -n 0

Follows the journal and shows only new entries, without the usual last ten lines.

Follow mode normally starts with the last ten lines, which is noise when I already know the history.

-f keeps the command running and prints new entries as they are written. -n 0 drops the lines it normally starts with, so the screen stays empty until something happens. That makes it easy to watch a service while you restart it in another terminal.

journalctl -u docker -f -n 0

Stop it with Ctrl-C. If you want the opposite, a lot of context before the live part, use -n 200 instead.

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