{"id":314,"date":"2019-10-21T19:44:25","date_gmt":"2019-10-21T17:44:25","guid":{"rendered":"http:\/\/linuxboxen2.dk\/?p=314"},"modified":"2019-10-21T19:44:25","modified_gmt":"2019-10-21T17:44:25","slug":"dmesg","status":"publish","type":"post","link":"https:\/\/www.linuxboxen.dk\/?p=314","title":{"rendered":"DMESG"},"content":{"rendered":"<p>DMESG(1)\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 User Commands\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 DMESG(1)<\/p>\n<p>NAME<\/p>\n<p>dmesg &#8211; print or control the kernel ring buffer<\/p>\n<p>SYNOPSIS<\/p>\n<p>dmesg [options]<\/p>\n<p>dmesg &#8211;clear<br \/>\ndmesg &#8211;read-clear [options]<br \/>\ndmesg &#8211;console-level level<br \/>\ndmesg &#8211;console-on<br \/>\ndmesg &#8211;console-off<\/p>\n<p>DESCRIPTION<\/p>\n<p>dmesg is used to examine or control the kernel ring buffer.<\/p>\n<p>The default action is to display all messages from the kernel ring<br \/>\nbuffer.<\/p>\n<p>OPTIONS<\/p>\n<p>The &#8211;clear, &#8211;read-clear, &#8211;console-on, &#8211;console-off, and<br \/>\n&#8211;console-level options are mutually exclusive.<\/p>\n<p>-C, &#8211;clear<br \/>\nClear the ring buffer.<\/p>\n<p>-c, &#8211;read-clear<br \/>\nClear the ring buffer after first printing its contents.<\/p>\n<p>-D, &#8211;console-off<br \/>\nDisable the printing of messages to the console.<\/p>\n<p>-d, &#8211;show-delta<br \/>\nDisplay the timestamp and the time delta spent between<br \/>\nmessages.\u00a0 If used together with &#8211;notime then only the time<br \/>\ndelta without the timestamp is printed.<\/p>\n<p>-E, &#8211;console-on<br \/>\nEnable printing messages to the console.<\/p>\n<p>-e, &#8211;reltime<br \/>\nDisplay the local time and the delta in human-readable format.<\/p>\n<p>-F, &#8211;file file<br \/>\nRead the messages from the given file.<\/p>\n<p>-f, &#8211;facility list<br \/>\nRestrict output to the given (comma-separated) list of<br \/>\nfacilities.\u00a0 For example:<\/p>\n<p>dmesg &#8211;facility=daemon<\/p>\n<p>will print messages from system daemons only.\u00a0 For all<br \/>\nsupported facilities see the &#8211;help output.<\/p>\n<p>-H, &#8211;human<br \/>\nEnable human-readable output.\u00a0 See also &#8211;color, &#8211;reltime and<br \/>\n&#8211;nopager.<\/p>\n<p>-k, &#8211;kernel<br \/>\nPrint kernel messages.<\/p>\n<p>-L, &#8211;color[=when]<br \/>\nColorize important messages (enabled by default).\u00a0 The<br \/>\noptional argument when can be auto, never or always.\u00a0 If the<br \/>\nwhen argument is omitted, it defaults to auto.<\/p>\n<p>-l, &#8211;level list<br \/>\nRestrict output to the given (comma-separated) list of levels.<br \/>\nFor example:<\/p>\n<p>dmesg &#8211;level=err,warn<\/p>\n<p>will print error and warning messages only.\u00a0 For all supported<br \/>\nlevels see the &#8211;help output.<\/p>\n<p>-n, &#8211;console-level level<br \/>\nSet the level at which printing of messages is done to the<br \/>\nconsole.\u00a0 The level is a level number or abbreviation of the<br \/>\nlevel name.\u00a0 For all supported levels see the &#8211;help output.<\/p>\n<p>For example, -n 1 or -n alert prevents all messages, except<br \/>\nemergency (panic) messages, from appearing on the console.<br \/>\nAll levels of messages are still written to \/proc\/kmsg, so<br \/>\nsyslogd(8) can still be used to control exactly where kernel<br \/>\nmessages appear.\u00a0 When the -n option is used, dmesg will not<br \/>\nprint or clear the kernel ring buffer.<\/p>\n<p>-P, &#8211;nopager<br \/>\nDo not pipe output into a pager.\u00a0 A pager is enabled by<br \/>\ndefault for &#8211;human output.<\/p>\n<p>-r, &#8211;raw<br \/>\nPrint the raw message buffer, i.e. do not strip the log-level<br \/>\nprefixes.<\/p>\n<p>Note that the real raw format depends on the method how<br \/>\ndmesg(1) reads kernel messages.\u00a0 The \/dev\/kmsg device uses a<br \/>\ndifferent format than syslog(2).\u00a0 For backward compatibility,<br \/>\ndmesg(1) returns data always in the syslog(2) format.\u00a0 It is<br \/>\npossible to read the real raw data from \/dev\/kmsg by, for<br \/>\nexample, the command &#8216;dd if=\/dev\/kmsg iflag=nonblock&#8217;.<\/p>\n<p>-S, &#8211;syslog<br \/>\nForce dmesg to use the syslog(2) kernel interface to read<br \/>\nkernel messages.\u00a0 The default is to use \/dev\/kmsg rather than<br \/>\nsyslog(2) since kernel 3.5.0.<\/p>\n<p>-s, &#8211;buffer-size size<br \/>\nUse a buffer of size to query the kernel ring buffer.\u00a0 This is<br \/>\n16392 by default.\u00a0 (The default kernel syslog buffer size was<br \/>\n4096 at first, 8192 since 1.3.54, 16384 since 2.1.113.)\u00a0 If<br \/>\nyou have set the kernel buffer to be larger than the default,<br \/>\nthen this option can be used to view the entire buffer.<\/p>\n<p>-T, &#8211;ctime<br \/>\nPrint human-readable timestamps.<\/p>\n<p>Be aware that the timestamp could be inaccurate!\u00a0 The time<br \/>\nsource used for the logs is not updated after system<br \/>\nSUSPEND\/RESUME.<\/p>\n<p>-t, &#8211;notime<br \/>\nDo not print kernel&#8217;s timestamps.<\/p>\n<p>&#8211;time-format format<br \/>\nPrint timestamps using the given format, which can be ctime,<br \/>\nreltime, delta or iso.\u00a0 The first three formats are aliases of<br \/>\nthe time-format-specific options.\u00a0 The iso format is a dmesg<br \/>\nimplementation of the ISO-8601 timestamp format.\u00a0 The purpose<br \/>\nof this format is to make the comparing of timestamps between<br \/>\ntwo systems, and any other parsing, easy.\u00a0 The definition of<br \/>\nthe iso timestamp is: YYYY-MM-<br \/>\nDD&lt;T&gt;HH:MM:SS,&lt;microseconds&gt;&lt;-+&gt;&lt;timezone offset from UTC&gt;.<\/p>\n<p>The iso format has the same issue as ctime: the time may be<br \/>\ninaccurate when a system is suspended and resumed.<\/p>\n<p>-u, &#8211;userspace<br \/>\nPrint userspace messages.<\/p>\n<p>-w, &#8211;follow<br \/>\nWait for new messages.\u00a0 This feature is supported only on<br \/>\nsystems with a readable \/dev\/kmsg (since kernel 3.5.0).<\/p>\n<p>-x, &#8211;decode<br \/>\nDecode facility and level (priority) numbers to human-readable<br \/>\nprefixes.<\/p>\n<p>-V, &#8211;version<br \/>\nDisplay version information and exit.<\/p>\n<p>-h, &#8211;help<br \/>\nDisplay help text and exit.<\/p>\n<p>COLORS<\/p>\n<p>Implicit coloring can be disabled by an empty file \/etc\/terminal-<br \/>\ncolors.d\/dmesg.disable.\u00a0 See terminal-colors.d(5) for more details<br \/>\nabout colorization configuration.<\/p>\n<p>The logical color names supported by dmesg are:<\/p>\n<p>subsys The message sub-system prefix (e.g. &#8220;ACPI:&#8221;).<\/p>\n<p>time\u00a0\u00a0 The message timestamp.<\/p>\n<p>timebreak<br \/>\nThe message timestamp in short ctime format in &#8211;reltime or<br \/>\n&#8211;human output.<\/p>\n<p>alert\u00a0 The text of the message with the alert log priority.<\/p>\n<p>crit\u00a0\u00a0 The text of the message with the critical log priority.<\/p>\n<p>err\u00a0\u00a0\u00a0 The text of the message with the error log priority.<\/p>\n<p>warn\u00a0\u00a0 The text of the message with the warning log priority.<\/p>\n<p>segfault<br \/>\nThe text of the message that inform about segmentation fault.<\/p>\n<p>SEE ALSO<\/p>\n<p>syslogd(8) terminal-colors.d(5)<\/p>\n<p>AUTHORS<\/p>\n<p>Karel Zak \u27e8kzak@redhat.com\u27e9<\/p>\n<p>dmesg was originally written by Theodore Ts&#8217;o \u27e8tytso@athena.mit.edu\u27e9<\/p>\n<p>AVAILABILITY<\/p>\n<p>The dmesg command is part of the util-linux package and is available<br \/>\nfrom Linux Kernel Archive<br \/>\n\u27e8ftp:\/\/ftp.kernel.org\/pub\/linux\/utils\/util-linux\/\u27e9.<\/p>\n<p>COLOPHON<\/p>\n<p>This page is part of the util-linux (a random collection of Linux<br \/>\nutilities) project.\u00a0 Information about the project can be found at<br \/>\n\u27e8https:\/\/www.kernel.org\/pub\/linux\/utils\/util-linux\/\u27e9.\u00a0 If you have a<br \/>\nbug report for this manual page, send it to<br \/>\nutil-linux@vger.kernel.org.\u00a0 This page was obtained from the<br \/>\nproject&#8217;s upstream Git repository<br \/>\n(git:\/\/git.kernel.org\/pub\/scm\/utils\/util-linux\/util-linux.git) on<br \/>\n2014-12-30.\u00a0 If you discover any rendering problems in this HTML ver\u2010<br \/>\nsion of the page, or you believe there is a better or more up-to-date<br \/>\nsource for the page, or you have corrections or improvements to the<br \/>\ninformation in this COLOPHON (which is not part of the original man\u2010<br \/>\nual page), send a mail to\u00a0man-pages@man7.org<\/p>\n<p>util-linux\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 July 2012\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 DMESG(1)<\/p>\n","protected":false},"excerpt":{"rendered":"<p>DMESG(1)\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 User Commands\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 DMESG(1) NAME dmesg &#8211; print or control the kernel ring buffer SYNOPSIS dmesg [options] dmesg &#8211;clear dmesg &#8211;read-clear [options] dmesg &#8211;console-level level dmesg &#8211;console-on dmesg &#8211;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 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_sitemap_exclude":false,"_sitemap_priority":"","_sitemap_frequency":"","footnotes":""},"categories":[8],"tags":[],"class_list":["post-314","post","type-post","status-publish","format-standard","hentry","category-shell"],"a3_pvc":{"activated":false,"total_views":0,"today_views":0},"_links":{"self":[{"href":"https:\/\/www.linuxboxen.dk\/index.php?rest_route=\/wp\/v2\/posts\/314","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.linuxboxen.dk\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.linuxboxen.dk\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.linuxboxen.dk\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.linuxboxen.dk\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=314"}],"version-history":[{"count":0,"href":"https:\/\/www.linuxboxen.dk\/index.php?rest_route=\/wp\/v2\/posts\/314\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.linuxboxen.dk\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=314"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.linuxboxen.dk\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=314"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.linuxboxen.dk\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=314"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}