---
name: "dmesg"
section: "8"
platform: "freebsd"
package: "base"
version: "16.0-CURRENT-20261027-61c70dc16a79"
release: "FreeBSD 16.0-CURRENT (2026-10-27)"
platforms: ["linux", "freebsd", "openbsd", "macos"]
url: "https://new.carta.tech/dmesg/8"
---

# dmesg(8)

display the kernel message buffer

## NAME

**dmesg** – display the kernel message buffer

## SYNOPSIS

**dmesg** \[**-ac**\] \[**-t** \[**-f** *output\_fmt*\]\] \[**-M** *core* \[**-N** *system*\]\]

## DESCRIPTION

The **dmesg** utility displays the contents of the kernel message buffer. If the **-M** option is not specified, the buffer is read from the currently running kernel via the [sysctl(3)](/sysctl/3.md) interface. Otherwise, the buffer is read from the specified core file, using the name list from the specified kernel image (or from the default image).

The options are as follows:

- **-a**

  Show all data in the message buffer. This includes any syslog records and */dev/console* output.

- **-c**

  Clear the kernel buffer after printing.

- **-t**

  Convert timestamps (see SYSCTL VARIABLES below) to an absolute date and time.

- **-f**

  If **-t** is also specified, use the specified *output\_fmt* for the conversion (see [strftime(3)](/strftime/3.md) manual page).

- **-M**

  Extract values associated with the name list from the specified core.

- **-N**

  If **-M** is also specified, extract the name list from the specified system instead of the default, which is the kernel image the system has booted from.

## SYSCTL VARIABLES

The following [sysctl(8)](/sysctl/8.md) variables control how the kernel timestamps entries in the message buffer: The default value is shown next to each variable.

- *kern.msgbuf\_show\_timestamp*: 0

  If set to 0, no timestamps are added. If set to 1, then a 1-second granularity timestamp will be added to most lines in the message buffer. If set to 2, then a microsecond granularity timestamp will be added. This may also be set as a boot [loader(8)](/loader/8.md) tunable. The timestamps are placed at the start of most lines that the kernel generates. Some multi-line messages will have only the first line tagged with a timestamp.

## FILES

- */var/run/dmesg.boot*

  usually a snapshot of the buffer contents taken soon after file systems are mounted at startup time

## SEE ALSO

[sysctl(3)](/sysctl/3.md), [syslogd(8)](/syslogd/8.md)

## HISTORY

The **dmesg** utility appeared in 3BSD.
