8:52 AMDMESG command in Linux : to display or control kernel ring buffer
dmesg - To display or control the kernel ring buffer
After boot up also, if a new hardware peripheral is connected dmesg displays the message about that peripheral.
The message could be error message like device not connected or a success message.
It is helpful in analysing and debugging any hardware related issue.
The program helps users to print out their bootup messages. Instead of copying the messages by hand, the user need only: dmesg > boot.messages or boot.msg and mail the boot.messages file to whoever can debug their problem.
You can set the buffer size to query the kernel ring buffer
If you have set the kernel buffer to be larger than the default then this option can be used to view the entire buffer.
Lets try to understand dmesg with some examples
1. Check bluetooth device drivers
2.To check memory status
3. To check ethernet drivers details, for example for first NIC eth0:
4. To check the status of usb connected to system
5. To check terminal type info
If you want to clear dmesg log, you can use -c option. This will clear the log till the system boots up again.
But if you connect any other device after this, you can see the log of the hardware again in dmesg output.
You need to be root to clear dmesg log. Suppose you have delete the dmesg log, and still you want to see the log you can see in /var/log/boot.msg or /var/log/kern.og
You may also like to see:
|Time command in Linux to give resource usage|
|Shift command with examples|
|uptime command in Linux|
|lwp-download: A command in linux to downlaod large files from internet|
|SETFACL command in Linux to set file access control list|
|Total comments: 0|