The dmesg command displays the content of the kernel’s message buffer since the system’s most recent boot. It displays a lot of details on how the system is working and problems it might be running into that you won’t normally see. That can be a lot of data, but there are several tricks for paring it down.
For example, Even though the system queried below has only been up a little more than three days, it’s collected more than a thousand lines of data.
$ dmesg | wc -l
If you type only dmesg, you will see all available data. Sudo access is not required. You can also pipe the output of dmesg to the more and less commands to scan through it or simply pipe the output to grep, but the command itself provides a lot of options for selecting the most relevant information from the file.
Source:: Network World – Data Center