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 -kf follows the kernel log live

Journalctl
~/tips/tip-journalctl-follow-kernel-messages

journalctl -kf

Follows kernel messages live, handy while you plug in or remove hardware.

When I plug in a disk or a USB device, I want to see what the kernel thinks of it right then.

-k limits the output to kernel messages and -f follows new ones. It is the journal version of dmesg --follow, with the benefit that the lines are also stored for later. Plug the device in and watch the lines appear.

journalctl -kf

The flag -k implies the current boot. For an older boot give -b an offset.

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