dmesg
Published on 24 Mar 2004Tags #Linux
Messages that are produced by the kernel are placed in a ring buffer which has a default size of 16392 bytes. This buffer is available from userspace via /proc/kmsg
. Messages are categorized into levels which are also used to decide which are printed to the console.
Define | Level | Description |
---|---|---|
KERN_EMERG | - | System is unusable |
KERN_ALERT | 1 | Action must be taken immediately |
KERN_CRIT | 2 | Critical conditions |
KERN_ERR | 3 | Error conditions |
KERN_WARNING | 4 | Warning conditions |
KERN_NOTICE | 5 | Normal but significant condition |
KERN_INFO | 6 | Informational |
KERN_DEBUG | 7 | Debug-level messages |
dmesg
allows printing and controlling the ring buffer:
-
Show content:
dmesg
-
Console verbosity level:
dmesg -n LEVEL
-
Ring buffer size:
dmesg -s SIZE
-
Clear ring buffer:
dmesg -c
Feedback is always welcome! If you'd like to get in touch with me concerning the contents of this article, please use Twitter.