HOME

TheInfoList



OR:

dmesg (''diagnostic messages'') is a command on most
Unix-like A Unix-like (sometimes referred to as UN*X, *nix or *NIX) operating system is one that behaves in a manner similar to a Unix system, although not necessarily conforming to or being certified to any version of the Single UNIX Specification. A Uni ...
operating systems that prints the message
buffer Buffer may refer to: Science * Buffer gas, an inert or nonflammable gas * Buffer solution, a solution used to prevent changes in pH * Lysis buffer, in cell biology * Metal ion buffer * Mineral redox buffer, in geology Technology and engineeri ...
of the kernel. The output includes messages produced by the
device driver In the context of an operating system, a device driver is a computer program that operates or controls a particular type of device that is attached to a computer or automaton. A driver provides a software interface to hardware devices, enabli ...
s.


Booting

When initially booted, a computer system loads its kernel into
memory Memory is the faculty of the mind by which data or information is encoded, stored, and retrieved when needed. It is the retention of information over time for the purpose of influencing future action. If past events could not be remembe ...
. At this stage
device driver In the context of an operating system, a device driver is a computer program that operates or controls a particular type of device that is attached to a computer or automaton. A driver provides a software interface to hardware devices, enabli ...
s present in the kernel are set up to drive relevant hardware. Such drivers, as well as other elements within the kernel, may produce output ("messages") reporting both the presence of modules and the values of any parameters adopted. (It may be possible to specify boot parameters which control the level of detail in the messages.) The booting process typically happens at a speed where individual messages scroll off the top of the screen before an operator can read/digest them. The command allows the review of such messages in a controlled manner after the system has started.


After booting

Even after the system has fully booted, the kernel may occasionally produce further diagnostic messages. Common examples of when this might happen are when I/O devices encounter errors, or
USB Universal Serial Bus (USB) is an industry standard, developed by USB Implementers Forum (USB-IF), for digital data transmission and power delivery between many types of electronics. It specifies the architecture, in particular the physical ...
devices are hot-plugged. dmesg provides a mechanism to review these messages at a later time. When first produced, they will be directed to the
system console A computer terminal is an electronic or electromechanical computer hardware, hardware device that can be used for entering data into, and transcribing data from, a computer or a computing system. Most early computers only had a front panel to ...
. If the console is in use, these messages may be confused with or quickly overwritten by the output of user programs.


Output

The output of dmesg can amount to many complete screens. For this reason, this output is normally reviewed using standard text-manipulation tools such as more,
tail The tail is the elongated section at the rear end of a bilaterian animal's body; in general, the term refers to a distinct, flexible appendage extending backwards from the midline of the torso. In vertebrate animals that evolution, evolved to los ...
,
less Less or LESS may refer to: Computing * less (Unix), a Unix utility program * Less (style sheet language), a dynamic style sheet language * Large-Scale Scrum (LeSS), a product development framework that extends Scrum Other uses * -less, a priv ...
or
grep grep is a command-line utility for searching plaintext datasets for lines that match a regular expression. Its name comes from the ed command g/re/p (global regular expression search and print), which has the same effect. grep was originally de ...
. Size of the dmesg buffer is limited and the output is often captured in a permanent system logfile via a logging daemon, such as
syslog In computing, syslog () is a standard for message logging. It allows separation of the software that generates messages, the system that stores them, and the software that reports and analyzes them. Each message is labeled with a facility code, ...
.


Format

Traditionally, dmesg lines begin with a device name followed by a colon, followed with detailed text. Often these come in clusters, with the same device showing up on multiple lines in succession. Each cluster is usually associated with a single device enumeration, by one particular device driver (or device facility) associated with the device name. Each driver or facility emits diagnostic information in its own chosen format. Device drivers may specify the format in the
manual page A man page (short for manual page) is a form of software documentation found on Unix and Unix-like operating systems. Topics covered include programs, system libraries, system calls, and sometimes local system details. The local host administra ...
by convention called identically to the
device file In Unix-like operating systems, a device file, device node, or special file is an interface to a device driver that appears in a file system as if it were an ordinary file. There are also special files in DOS, OS/2, and Windows. These s ...
name without the trailing number.


See also

*
List of Unix commands This is a list of the shell commands of the most recent version of the Portable Operating System Interface (POSIX) IEEE Std 1003.1-2024 which is part of the Single UNIX Specification (SUS). These commands are implemented in many shells on moder ...
* lspci, detailed information about all PCI buses and devices in the system * lsusb, detailed information about USB ports and devices * uname prints the name, version and other details about the current machine and the operating system *
Ring buffer In computer science, a circular buffer, circular queue, cyclic buffer or ring buffer is a data structure that uses a single, fixed-size buffer as if it were connected end-to-end. This structure lends itself easily to buffering data streams. Ther ...
, the structure of the buffer used by dmesg *
udev udev (userspace ) is a device manager for the Linux kernel. As the successor of devfsd and hotplug, udev primarily manages device nodes in the directory. At the same time, udev also handles all user space events raised when hardware devices ...
Linux device manager, with some control over device visibility


References

{{Reflist


External links


dmesg(8)
FreeBSD manual page

by The Linux Information Project (LINFO)

kernel output examples Unix software Year of introduction missing