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: dmesg -T gives kernel messages readable timestamps

Dmesg
~/tips/dmesg-t

sudo dmesg -T | tail -30

Shows kernel messages with real clock times instead of seconds since boot.

The default dmesg output starts every line with seconds since boot. That is useless when you want to know what happened at 14:05.

sudo dmesg -T | tail -30
sudo dmesg --level=err,warn

-T converts the timestamps to dates and times. The second command shows only errors and warnings, which is where a failing disk or a USB reset shows up first.

Caveat: the readable times are calculated from the boot time and can be off by a while after the machine has been suspended. Treat them as a good hint. Many distributions also need sudo to read the kernel log.

Further reading: dmesg(1)

More Dmesg tips sudo dmesg -C sudo dmesg -x sudo dmesg -r > kernel.raw sudo dmesg -n 4 All Dmesg tips (5) All topics

Link