dmesg: show log events from kernel ring buffer
shows log messages in the kernel ring buffer
Typical usage: diagnosing problems, information gathering, system administration, troubleshootingIntroduction into dmesg
The dmesg
command can be used to show the contents of the Linux kernel ring buffer and important kernel logging. It includes events about the boot process, hardware, systemd, segmentation faults of processes, and more.
Installation
When dmesg is not installed by default, it can be added to the system using the relevant software package.
Package information for dmesg
Operating system | Package name | Installation |
---|---|---|
AlmaLinux | util-linux-core |
|
Arch Linux | util-linux |
|
Debian | util-linux |
|
Fedora | util-linux-core |
|
Red Hat Enterprise Linux | util-linux-core |
|
Rocky Linux | util-linux-core |
|
openSUSE | util-linux |
|
Ubuntu | util-linux |
|
Your Linux distribution using a different package? Share your feedback.
Usage
Available options
Long option | Short option | Description |
---|---|---|
--clear | -C | Clear the ring buffer |
--ctime | -T | Show the date and time instead of time in seconds |
--level=LEVEL[,LEVEL2] | -l | Show only entries from specific log level or levels, such as debug, err, info, warn |
Missing an option in this overview? Share your feedback.
Examples using dmesg
Show log entries from the kernel ring buffer
dmesg
Only show errors
dmesg --level=err
Frequently Asked Questions
What is the dmesg command and its purpose?
The dmesg command is a command-line tool to show log evens from the kernel ring buffer.
Which package provides the dmesg command?
The command dmesg is provided by the util-linux or util-linux-core package.
Relevant articles using the dmesg command
The following articles include an example on how to use dmesg and might be worth further exploring.
- What is a kernel ring buffer?
- Understanding memory information on Linux systems
- How to use grep (with examples)
- Livepatch: Linux kernel updates without rebooting
Related and similar commands
Linux has a lot of tools and commands available and sometimes you just need that little other tool. Here is a list of commands that are similar or related to dmesg:
Command | Category | Summary |
---|---|---|
capsh | capabilities | Linux capabilities testing and debugging tool |
captest | capabilities | Capabilities and privilege escalation testing tool |
chrt | processes | Sets Linux scheduler policy and priority for a process or command |
filecap | capabilities | Display of Linux capabilities set on binaries in paths |
firejail | sandboxing | Sandboxing tool for Linux |
getcap | capabilities | Show file capabilities |
getpcaps | capabilities | Show process capabilities |
journalctl | logging | Logging facility for Linux systems using systemd |
lsns | namespaces | Shows used namespaces |
lsusb | capabilities | Show USB devices |
netcap | capabilities | Display available capabilities for running processes using network sockets |
pscap | capabilities | Display available capabilities for running processes |
pslog | logging | Shows which log files a process has opened |
setcap | capabilities | Add or remove Linux capabilities to a file |
slabtop | memory | Shows slab usage of kernel |
uname | system information | Shows basic system information |