What is dmesg?
dmesg (short for “display message” or “driver message”) is one of the most important and simplest diagnostic tools in any Linux system. It allows you to read messages from the kernel ring buffer.
Think of this buffer as your system’s black box. From the very moment the computer starts, the Linux kernel writes all important information into it: what it has detected, which drivers it has loaded, and whether it has encountered any errors. dmesg is the command that lets us look inside this box.