What command displays the kernel ring buffer messages in Linux? The command is `dmesg`. It prints diagnostic messages stored by the Linux kernel, including information produced by hardware drivers during boot and while the system is running.
The name is commonly explained as short for “diagnostic messages.” The kernel ring buffer is a fixed-size, circular memory area: when it fills, newer entries can overwrite older ones. That makes `dmesg` especially useful for investigating newly connected devices, hardware detection, firmware problems, boot warnings, and driver errors.
`dmesg` is not the same as `journalctl`, although both can show kernel-related events on systems using systemd. `journalctl -k` reads kernel records held by the system journal, which may preserve information beyond the current ring-buffer contents. Access to some `dmesg` output may also be restricted on hardened systems, requiring elevated privileges.