dmesg
system managementLinux/Unix
The dmesg command is one of the most frequently used commands in Linux/Unix-like operating systems. dmesg Display or control the kernel ring buffer messages
Quick Reference
Command Name:
dmesg
Category:
system management
Platform:
Linux/Unix
Basic Usage:
dmesg [options] [arguments]
Common Use Cases
Syntax
dmesg [options]
Options
Option | Description |
---|---|
-c, --clear |
Clear the ring buffer after printing |
-C, --read-clear |
Clear the ring buffer after printing and only print new messages |
-f, --facility list |
Restrict output to defined facilities |
-l, --level list |
Restrict output to defined levels |
-n, --console-level level |
Set level of messages printed to console |
-r, --raw |
Print the raw message buffer |
-s, --buffer-size size |
Buffer size to query the kernel |
-T, --ctime |
Show human-readable timestamps |
-w, --follow |
Wait for new messages |
--since=time |
Show only records since the specified time |
--until=time |
Show only records until the specified time |
Examples
How to Use These Examples
The examples below show common ways to use the dmesg
command. Try them in your terminal to see the results. You can copy any example by clicking on the code block.
# Basic Examples Basic
dmesg