dmesg Cheat Sheet
Print the kernel ring buffer — hardware, driver, and boot failures that never reach userspace.
Troubleshooting3 sections · 14 commands
⌘K
Viewing
5dmesgPrint the kernel ring buffer
dmesg | tail -n 50Most recent kernel messages
dmesg -wFollow new messages live
dmesg -THuman-readable timestamps
dmesg -HColored, human-friendly output
Filtering by Level & Facility
6dmesg -l errErrors only
dmesg -l err,warnErrors and warnings
dmesg -tSuppress timestamps
dmesg | grep -i usbUSB-related messages
dmesg | grep -iE 'error|fail'Anything that looks broken
dmesg -f kernFilter by kernel facility
Userspace Access
3journalctl -k -bKernel messages of this boot (via journal)
sudo dmesg --ctimeTimestamps in local time (needs perms)
echo 0 | sudo tee /proc/sys/kernel/dmesg_restrictAllow unprivileged reads