LinuxCommandLibrary
GitHubF-DroidGoogle Play Store

dmesg

kernel ring buffer message viewer

TLDR

Show kernel messages
$ sudo dmesg
copy
Show kernel error messages
$ sudo dmesg -l err
copy
Follow kernel messages in real-time
$ sudo dmesg -w
copy
Show messages with human-readable timestamps
$ sudo dmesg -T
copy
Show messages in human-readable form
$ sudo dmesg -H
copy
Colorize output
$ sudo dmesg -L
copy
Filter messages by facility
$ sudo dmesg -f kern
copy

SYNOPSIS

dmesg [-l level] [-f facility] [-T] [-H] [-w] [-L]

DESCRIPTION

dmesg prints and controls the kernel ring buffer, which contains messages from the kernel including hardware detection, driver loading, and system events. It is essential for debugging hardware and driver issues.

PARAMETERS

-l, --level level

Restrict output to specified log levels (emerg, alert, crit, err, warn, notice, info, debug)
-f, --facility facility
Restrict output to specified facilities (kern, user, mail, daemon, etc.)
-T, --ctime
Print human-readable timestamps
-H, --human
Enable human-readable output with colors and timestamps
-w, --follow
Wait for new messages (like tail -f)
-L, --color
Colorize output
-c, --read-clear
Clear the ring buffer after printing
-C, --clear
Clear the ring buffer without printing
-n, --console-level level
Set level of messages printed to console
-k, --kernel
Print kernel messages only
-u, --userspace
Print userspace messages only
--time-format format
Timestamp format: ctime, reltime, delta, iso, raw
--since time
Display records since the specified time
--until time
Display records until the specified time
-J, --json
Output in JSON format
-t, --notime
Do not print kernel timestamps
-r, --raw
Print raw message buffer with log-level prefixes
-x, --decode
Decode facility and level to human-readable prefixes

INSTALL

sudo apt install util-linux
copy
sudo dnf install util-linux
copy
sudo pacman -S util-linux
copy
sudo apk add dmesg
copy
sudo zypper install util-linux
copy
brew install util-linux
copy
nix profile install nixpkgs#util-linux
copy

CAVEATS

Requires root privileges on most systems. The -w (follow) option requires kernel 3.5.0+ (for /dev/kmsg). The -T and -H options are util-linux userspace features and do not require a specific kernel version.

HISTORY

Part of util-linux package. The kernel ring buffer has been part of Linux since early versions, providing essential diagnostic information.

SEE ALSO

journalctl(1), tail(1)

Braincup
Open source brain training for math, memory and focus
Braincup mini-games
41 mini-games · Apache-2.0
No ads · No tracking
Play in browser
Download Braincup on the App StoreGet Braincup on Google PlayGet Braincup on F-Droid
276 stars
From the maker of Linux Command Library
Copied to clipboard
Braincup
Open source brain training for math, memory and focus. 41 mini-games, from mental arithmetic to Sudoku, N-Back and Solo Chess.
Apache-2.0 licensed · No ads · No tracking · No account
From the maker of Linux Command Library
Download Braincup on the App StoreGet Braincup on Google PlayGet Braincup on F-Droid