dmesg: show log events from kernel ring buffer

shows log messages in the kernel ring buffer

Typical usage: diagnosing problems, information gathering, system administration, troubleshooting

Introduction 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 systemPackage nameInstallation
AlmaLinuxutil-linux-core
dnf install util-linux-core
Arch Linuxutil-linux
pacman -S util-linux
Debianutil-linux
apt install util-linux
Fedorautil-linux-core
dnf install util-linux-core
Red Hat Enterprise Linuxutil-linux-core
dnf install util-linux-core
Rocky Linuxutil-linux-core
dnf install util-linux-core
openSUSEutil-linux
zypper install util-linux
Ubuntuutil-linux
apt install util-linux

Your Linux distribution using a different package? Share your feedback.

Usage

Available options

Long optionShort optionDescription
--clear-CClear the ring buffer
--ctime-TShow the date and time instead of time in seconds
--level=LEVEL[,LEVEL2]-lShow 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.

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:

Related and similar commands to dmesg
CommandCategorySummary
capshcapabilitiesLinux capabilities testing and debugging tool
captestcapabilitiesCapabilities and privilege escalation testing tool
chrtprocessesSets Linux scheduler policy and priority for a process or command
filecapcapabilitiesDisplay of Linux capabilities set on binaries in paths
firejailsandboxingSandboxing tool for Linux
getcapcapabilitiesShow file capabilities
getpcapscapabilitiesShow process capabilities
journalctlloggingLogging facility for Linux systems using systemd
lsnsnamespacesShows used namespaces
lsusbcapabilitiesShow USB devices
netcapcapabilitiesDisplay available capabilities for running processes using network sockets
pscapcapabilitiesDisplay available capabilities for running processes
pslogloggingShows which log files a process has opened
setcapcapabilitiesAdd or remove Linux capabilities to a file
slabtopmemoryShows slab usage of kernel
unamesystem informationShows basic system information