SysTutorials

Man Pages › Section 1

dmesg(1)

NAME

dmesg – print or control the kernel ring buffer

SYNOPSIS

dmesg [options]

dmesg –clear

dmesg –read-clear [options]

dmesg –console-level level

dmesg –console-on

dmesg –console-off

DESCRIPTION

dmesg is used to examine or control the kernel ring buffer.

The default action is to display all messages from the kernel ring buffer.

OPTIONS

The –clear, –read-clear, –console-on, –console-off, and –console-level options are mutually exclusive.

-C, –clear

Clear the ring buffer.

-c, –read-clear

Clear the ring buffer after first printing its contents.

-D, –console-off

Disable the printing of messages to the console.

-d, –show-delta

Display the timestamp and the time delta spent between messages. If used together with –notime then only the time delta without the timestamp is printed.

-E, –console-on

Enable printing messages to the console.

-e, –reltime

Display the local time and the delta in human-readable format. Be aware that conversion to the local time could be inaccurate (see -T for more details).

-F, –file file

Read the syslog messages from the given file. Note that -F does not support messages in kmsg format. The old syslog format is supported only.

-f, –facility list

Restrict output to the given (comma-separated) list of facilities. For example:

dmesg –facility=daemon

will print messages from system daemons only. For all supported facilities see the –help output.

-H, –human

Enable human-readable output. See also –color, –reltime and –nopager.

-k, –kernel

Print kernel messages.

-L, –color[=when]

Colorize the output. The optional argument when can be auto, never or always. If the when argument is omitted, it defaults to auto. The colors can be disabled; for the current built-in default see the –help output. See also the COLORS section below.

-l, –level list

Restrict output to the given (comma-separated) list of levels. For example:

dmesg –level=err,warn

will print error and warning messages only. For all supported levels see the –help output.

-n, –console-level level

Set the level at which printing of messages is done to the console. The level is a level number or abbreviation of the level name. For all supported levels see the –help output.

For example, -n 1 or -n emerg 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.

–noescape

The unprintable and potentially unsafe characters (e.g., broken multi-byte sequences, terminal controlling chars, etc.) are escaped in format