- Show kernel messages:dmesg- Show kernel error messages:dmesg --level err- Show kernel messages and keep reading new ones, similar to `tail -f` (available in kernels 3.5.0 and newer):dmesg -w- Show how much physical memory is available on this system:dmesg | grep -i memory- Show kernel messages 1 page at a time:dmesg | less
dmesg --clear dmesg --read-clear [options] dmesg --console-level level dmesg --console-on dmesg --console-off
dmesg is used to examine or control the kernel ring buffer.
The default action is to display all messages from the kernel ring buffer.
The --clear, --read-clear, --console-on, --console-off, and --console-level options are mutually exclusive.
For example, -n 1 or -n alert prevents all messages, except emergency (panic) messages, from appearing on the console. All levels of messages are still written to /proc/kmsg, so syslogd(8) can still be used to control exactly where kernel messages appear. When the -n option is used, dmesg will not print or clear the kernel ring buffer.
Note that the real raw format depends on the method how dmesg(1) reads kernel messages. The /dev/kmsg device uses a different format than syslog(2). For backward compatibility, dmesg(1) returns data always in the syslog(2) format. It is possible to read the real raw data from /dev/kmsg by, for example, the command 'dd if=/dev/kmsg iflag=nonblock'.
Implicit coloring can be disabled by an empty file /etc/terminal-colors.d/dmesg.disable. See terminal-colors.d(5) for more details about colorization configuration.
The logical color names supported by dmesg are:
dmesg was originally written by Theodore Ts'o
The dmesg command is part of the util-linux package and is available from Linux Kernel Archive