On Linux operating systems, the dmesg command examines or controls the kernel ring buffer.
The kernel ring buffer is a data structure that records messages related to the operation of the kernel. A ring buffer is a special kind of buffer that is always a constant size, removing the oldest messages when new messages are received.
Syntax
dmesg [options]
Options
The default action of dmesg is to read all messages from kernel ring buffer.
- Syntax
- Examples
- Related commands
- Linux commands help
Examples
dmesg > kernel_msgs.txt
Output all kernel messages currently in the ring buffer to a file called kernel_msgs.txt.
dmesg | grep -i memory
Display only those kernel messages which relate to memory usage.
Related commands
sysklogd — Linux system logging utilities.