dmesg (''diagnostic messages'') is a command on most
Unix-like
A Unix-like (sometimes referred to as UN*X 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 Unix-li ...
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
* Buffering agent, the weak acid or base in a buffer solution
* Lysis buffer, in cell biology
* Metal ion buffer
* ...
of the
kernel
Kernel may refer to:
Computing
* Kernel (operating system), the central component of most operating systems
* Kernel (image processing), a matrix used for image convolution
* Compute kernel, in GPGPU programming
* Kernel method, in machine learnin ...
. The output includes messages produced by the
device driver
In computing, 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, enabling operating systems and ot ...
s.
Command
On many Unix-like systems, the
boot process
In computing, booting is the process of starting a computer as initiated via hardware such as a button or by a software command. After it is switched on, a computer's central processing unit (CPU) has no software in its main memory, so so ...
generates a particularly dense stream of kernel messages. Many administrative issues pertain to whether a desired hardware device is successfully
enumerated during the boot process, so the diagnostic process for a failed device often begins by inspecting the dmesg output from the kernel identification message to the point where the boot process concludes. Since this buffer can be overwritten by a flood of messages in subsequent operation, many Unix-like distributions store a post-boot copy of the message buffer at or similar secure system location.
It is also common to manually consult the current dmesg buffer after
hot-plugging
Hot swapping is the replacement or addition of components to a computer system without stopping, shutting down, or rebooting the system; hot plugging describes the addition of components only. Components which have such functionality are said ...
devices, particularly
USB device
Universal Serial Bus (USB) is an industry standard that establishes specifications for cables, connectors and protocols for connection, communication and power supply (interfacing) between computers, peripherals and other computers. A broad v ...
s (especially
thumb drives
A USB flash drive (also called a thumb drive) is a data storage device that includes flash memory with an integrated USB interface. It is typically removable, rewritable and much smaller than an optical disc. Most weigh less than . Since first ...
), to determine whether the device has been recognized, the data rate of the port involved (
USB 2
Universal Serial Bus (USB) is an industry standard that establishes specifications for cables, connectors and protocols for connection, communication and power supply ( interfacing) between computers, peripherals and other computers. A broa ...
and
USB 3.0
USB 3.0, released in November 2008, is the third major version of the Universal Serial Bus (USB) standard for interfacing computers and electronic devices. Among other improvements, USB 3.0 adds the new transfer rate referred to as '' ...
plugs sit side by side and are hard to distinguish on many systems), what driver has been assigned, and where the device is made visible in the file system. Many distributions attempt to display device-recognition messages on the desktop, often through a
taskbar
A taskbar is an element of a graphical user interface which has various purposes. It typically shows which programs are currently running.
The specific design and layout of the taskbar varies between individual operating systems, but generally a ...
pop-up, but this is not always reliable or the information presented is incomplete. (Furthermore, to be notified on the desktop, the hot-plugged device must be permitted by the system's
security policy
Security policy is a definition of what it means to ''be secure'' for a system, organization or other entity. For an organization, it addresses the constraints on behavior of its members as well as constraints imposed on adversaries by mechanisms ...
.)
Many dmesg lines in a traditional system begin with a device name followed by a colon, followed by some 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 such driver or facility emits diagnostic information in its own chosen format, and generally includes all of the most important technical details, in a dense and arcane notation. The
manual page
A man page (short for manual page) is a form of software documentation usually found on a Unix or Unix-like operating system. Topics covered include computer programs (including library and system calls), formal standards and conventions, and ev ...
associated with the device driver will sometimes document the message format. For example, device name (
SCSI
Small Computer System Interface (SCSI, ) is a set of standards for physically connecting and transferring data between computers and peripheral devices. The SCSI standards define commands, protocols, electrical, optical and logical interface ...
direct access ) is a commonly seen device name associated with USB thumb drives. at the
command line
A command-line interpreter or command-line processor uses a command-line interface (CLI) to receive commands from a user in the form of lines of text. This provides a means of setting parameters for the environment, invoking executables and pro ...
—without the trailing number—will bring up documentation for this driver class on many systems. Even if the precise format of the lines written to the system buffer are not described here, the parameters of interest are usually defined, though you might need to further peruse related manual pages (listed at the bottom of a traditional man page) for a complete overview spanning various
hardware abstraction
Hardware abstractions are sets of routines in software that provide programs with access to hardware resources through programming interfaces. The programming interface allows all devices in a particular class ''C'' of hardware devices to be acce ...
layers
Layer or layered may refer to:
Arts, entertainment, and media
* ''Layers'' (Kungs album)
* ''Layers'' (Les McCann album)
* ''Layers'' (Royce da 5'9" album)
*"Layers", the title track of Royce da 5'9"'s sixth studio album
*Layer, a female Maveric ...
.
Booting
When initially
booted, a computer system loads its kernel into memory. At this stage
device driver
In computing, 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, enabling operating systems and ot ...
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. (Some keyboard keys may pause the screen output.) 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 that establishes specifications for cables, connectors and protocols for connection, communication and power supply (interfacing) between computers, peripherals and other computers. A broad v ...
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
One meaning of system console, computer console, root console, computer operator, operator's console, or simply console is the text entry and display device for system administration messages, particularly those from the BIOS or boot loader, the ...
: if the console is in use then these messages may be confused with or quickly overwritten by the output of user programs.
Output
![Clocksource on Linux booting screenshot](https://upload.wikimedia.org/wikipedia/commons/b/ba/Clocksource_on_Linux_booting_screenshot.png)
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
More or Mores may refer to:
Computing
* MORE (application), outline software for Mac OS
* more (command), a shell command
* MORE protocol, a routing protocol
* Missouri Research and Education Network
Music Albums
* ''More!'' (album), by Booka S ...
,
tail
The tail is the section at the rear end of certain kinds of animals’ bodies; in general, the term refers to a distinct, flexible appendage to the torso. It is the part of the body that corresponds roughly to the sacrum and coccyx in mammals, r ...
,
less
Less or LESS may refer to: fewer than,: not as much.
Computing
* less (Unix), a Unix utility program
* Less (stylesheet language), a dynamic stylesheet language
* Large-Scale Scrum (LeSS), a product development framework that extends Scrum
Other ...
or
grep
grep is a command-line utility for searching plain-text data sets for lines that match a regular expression. Its name comes from the ed command ''g/re/p'' (''globally search for a regular expression and print matching lines''), which has the sam ...
.
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, i ...
.
See also
*
lspci
lspci is a command on Unix-like operating systems that prints ("lists") detailed information about all PCI buses and devices in the system. It is based on a common portable library ''libpci'' which offers access to the PCI configuration space on ...
, detailed information about all PCI buses and devices in the system
*
lsusb
lspci is a command on Unix-like operating systems that prints ("lists") detailed information about all PCI buses and devices in the system. It is based on a common portable library ''libpci'' which offers access to the PCI configuration space on ...
, detailed information about USB ports and devices
*
uname
uname (short for ''unix name'') is a computer program in Unix and Unix-like computer operating systems that prints the name, version and other details about the current machine and the operating system running on it.
History
The uname system cal ...
prints the name, version and other details about the current machine and the operating system
*
List of Unix commands
This is a list of Unix commands as specified by IEEE Std 1003.1-2008, which is part of the Single UNIX Specification (SUS). These commands can be found on Unix operating systems and most Unix-like operating systems.
List
See also
* List of G ...
*
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 ar ...
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