What is dmesg?
dmesg command is used to write the kernel messages to standard output.
Kernel is the core of the Operating System. The first part of the Operating System that is being loaded during the boot process is kernel.
Kernel controls virtually everything on the system. A numerous messages will be shown on the display screen as computer boots up. This messages show the hardware devices that the kernel detects and whether it is able to configure them or not.
How Does dmesg work?
Command dmesg obtains its data from the Kernel Ring Buffer. In general Buffer is a temporary amount of space associated with every device like hard disk; printer. A ring buffer is a buffer of fixed size for which any new data added to it overwrites the oldest data in it.
How to use dmesg?
Usage of dmesg:
dmesg [options]
Invoking dmesg without any of its options (which are rarely used) causes it to write all the kernel messages to standard output.
dmesg | less
Example, the following command lists all references to USB (universal serial bus) devices in the kernel messages:
dmesg | grep -i usb
Following tells dmesg to show all serial ports (which are represented by the string tty):
dmesg | grep -i tty
The dmesg and grep combination can also be used to show how much physical memory (i.e., RAM) is available on the system:
dmesg | grep -i memory
The output of dmesg is maintained in the log file /var/log/dmesg.
cat /var/log/dmesg | less.
Trackbacks
[...] dmesg command prints the messages that occur during the boot process to standard [...]