Glossary

dmesg

dmesg ("display message" or "driver message") prints the kernel's ring buffer of messages: early-boot progress, driver initialisation, hardware events, and errors that the kernel has logged since startup. Before systemd journald existed, dmesg was the primary way to diagnose boot failures, flaky drivers, and hardware problems.

dmesg                       # print the whole buffer
dmesg -T                    # human-readable timestamps
dmesg -w                    # follow new messages as they arrive
dmesg --level=err,warn      # filter by severity
dmesg -H                    # paged, colorised output

On modern systems, journalctl -k (or journalctl --dmesg) shows the same information, persisted across reboots. The kernel's ring buffer has a fixed size (typically a few hundred kilobytes), so messages scroll out eventually; the journal captures them before that happens.

Typical uses include checking why a USB device was not recognised, investigating OOM kills (dmesg | grep -i kill), spotting disk I/O errors, and tracking down segfault entries that indicate a crashed program. It is one of the first places to look when something mysterious has gone wrong, and reading it regularly on a production system is a good habit.

Related terms: Kernel

Discussed in:

Also defined in: Textbook of Linux