Explanation: The command that displays the contents of the Kernel Ring Buffer on the command line is dmesg12. The dmesg command is a Linux utility that displays kernel-related messages retrieved from the kernel ring buffer12. The ring buffer stores information about hardware, device driver initialization, and messages fromkernel modules that take place during system startup12. The dmesg command is invaluable when troubleshooting hardware-related errors, warnings, and for diagnosing device failure2.
The dmesg command can be used with various options to control the output format, filter the messages by facility or level, clear the ring buffer, or follow the new messages in real time123. For example, the following command displays the last 10 messages from the kernel ring buffer:
$ dmesg | tail -10
The following command displays the messages from the kernel ring buffer in a human-readable format with colored output:
$ dmesg -H --color
The following command displays the messages from the kernel ring buffer that have the facility kern and the level emerg:
$ dmesg -f kern -l emerg
The following command clears the ring buffer:
$ dmesg --clear
The following command keeps dmesg running and waiting for new messages:
$ dmesg -w
References:
1: dmesg Linux Command {Syntax, Options and Examples} - phoenixNAP 2: Ubuntu Manpage: dmesg - print or control the kernel ring buffer 3: Display Recent Kernel Messages (console, kernel ring buffer, facilities)