dmesg Cheat Sheet

Print the kernel ring buffer — hardware, driver, and boot failures that never reach userspace.

Troubleshooting3 sections · 14 commands
⌘K

Viewing

5
dmesg

Print the kernel ring buffer

dmesg | tail -n 50

Most recent kernel messages

dmesg -w

Follow new messages live

dmesg -T

Human-readable timestamps

dmesg -H

Colored, human-friendly output

Filtering by Level & Facility

6
dmesg -l err

Errors only

dmesg -l err,warn

Errors and warnings

dmesg -t

Suppress timestamps

dmesg | grep -i usb

USB-related messages

dmesg | grep -iE 'error|fail'

Anything that looks broken

dmesg -f kern

Filter by kernel facility

Userspace Access

3
journalctl -k -b

Kernel messages of this boot (via journal)

sudo dmesg --ctime

Timestamps in local time (needs perms)

echo 0 | sudo tee /proc/sys/kernel/dmesg_restrict

Allow unprivileged reads