Driver FixRecommendedSound, Wi-Fi or graphics acting up? Check drivers firstFind missing or outdated drivers fast.Check DriversOctober DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsClean PCRecommendedOne scan can reveal what keeps slowing WindowsLook for cleanup and repair opportunities.Run Scan×
Skip to content
World desk4 min

How to Use dmesg in Linux: 12 Commands for Kernel Troubleshooting

Use dmesg to inspect Linux kernel messages, filter warnings and errors, follow new device events, and check retained prior-boot records with journalctl.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Use dmesg to inspect messages in the Linux kernel ring buffer, then narrow them by priority, facility, wording, or timing to investigate a boot, hardware, or device problem. The command can show what the kernel reported, but a warning or error is a clue—not proof of the root cause. For an issue from an earlier boot on a systemd system, try journalctl -k -b -1 if the journal retained those records.

What dmesg can show—and what it cannot

The upstream util-linux manual describes dmesg as a tool to “examine or control the kernel ring buffer.” Its default action displays messages currently available there. Those messages can help you investigate startup, hardware detection, device connections, and kernel-reported errors.

As an Amazon Associate I earn from qualifying purchases.

The ring buffer is not a complete, permanent history of every event on the machine. Its contents may not include messages from an earlier boot, and old entries may no longer be available. Use the messages alongside the symptom you observed and other relevant logs rather than treating one line as a diagnosis.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

12 useful command patterns

Options vary by util-linux version and distribution build. Check your installed command before relying on an option:

dmesg --help

1. Display available kernel messages

dmesg

Start here for a broad view of the messages currently in the kernel ring buffer. If the output is long, search for a device name, driver, recognizable error text, or the approximate time the problem began.

2. Watch for new messages

dmesg --follow

Where readable /dev/kmsg support is available, this waits for new kernel messages. Keep it open while reproducing an issue—for example, while connecting a device—and note which entries appear at that moment.

3. Show errors and warnings

dmesg --level=err,warn

This limits output to the error and warning priorities where supported. It can reduce noise during an initial scan, but less severe messages may still provide useful context.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

4. Limit output to the kernel facility

dmesg --facility=kern

Where supported, this selects messages associated with the kernel facility. It is useful when the output contains multiple facilities and you want to focus on kernel entries.

5. Decode facility and priority names

dmesg --decode

This asks dmesg to display facility and priority in human-readable form. Use it when the message metadata is less familiar than the message text itself.

6. Use human-readable output and pager behavior

dmesg --human

Where available, this requests human-readable output and pager behavior. The exact display depends on the installed build and terminal environment; consult dmesg --help for its supported behavior.

7. Show time deltas between messages

dmesg --show-delta

This displays the time difference between adjacent messages. Deltas can help you see whether a burst of messages followed a device failure or whether activity was spread over a longer period.

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

8. Show local time with deltas

dmesg --reltime

This requests local-time display and deltas where supported. Treat converted wall-clock timestamps as approximate context, not guaranteed exact event times: the manual documents accuracy caveats for human-readable time conversion.

9. Request ISO-style timestamps

dmesg --time-format=iso

Where supported, this requests ISO-style timestamps. Valid formats can differ by version, so check the local help before using a format in a script or troubleshooting procedure.

10. Clear the kernel ring buffer

dmesg --clear

This changes diagnostic state by clearing the ring buffer. Do not run it casually while preserving evidence matters: messages you could otherwise inspect may be lost from that buffer.

11. Read supported syslog-format messages from a file

dmesg --file FILE

Replace FILE with the path to a file containing supported syslog-format messages. The upstream manual notes that this mode does not support kmsg-format messages; check the manual and your installed help for details.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

12. Query kernel messages from the previous boot

journalctl -k -b -1

This is a journalctl command, not a dmesg option. On a systemd system, it selects kernel messages from the previous boot if the journal collected and retained them. The journalctl manual documents kernel-only and boot-selection options.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

How to investigate a kernel or device problem

  1. Begin with a read-only check. Run dmesg to see the messages currently available. Avoid clearing the buffer if you may need its contents as evidence.
  2. Narrow the output to the symptom. Try a priority filter such as --level=err,warn, a facility filter such as --facility=kern, or search the displayed text for the device name or a distinctive phrase. Option support depends on your installed build.
  3. Compare message order and timing. Use deltas where available, and compare nearby entries with the time the symptom began. For a device problem, connect or reproduce the failure while watching with dmesg --follow, if permitted, and correlate new messages with that action.
  4. Check other logs and the actual symptom. A warning or error does not establish root cause on its own. Look for related evidence and whether the message coincides with the behavior you are troubleshooting.
  5. For a previous-boot issue, check the journal. On a systemd system, run journalctl -k -b -1 to request kernel messages from the prior boot. Results depend on journal collection and retention; use journal boot selection or filtering to focus the records further.

If dmesg reports permission denied

Access may be restricted by the kernel’s dmesg_restrict setting. The upstream manual notes this as a common cause of access denial. Do not treat disabling the restriction as a routine troubleshooting step. Ask an authorized administrator to assess the system’s security policy and determine whether access is appropriate.

dmesg and journalctl: which should you use?

Question dmesg journalctl -k -b -1
What does it read? Messages available in the current kernel ring buffer. Kernel messages collected in the systemd journal for the previous boot.
How far back can it go? Limited to messages still available in the ring buffer. Can select a prior boot when its records were collected and retained.
How can you narrow results? Supported message priority and facility filters, plus recognizable message text. Kernel-message selection and boot selection; journal filtering can further narrow records.
What does access depend on? Permission to read the kernel buffer, which may be restricted by dmesg_restrict. A systemd journal with the relevant records available and retained.

These commands address different sources and time ranges. Use dmesg for messages available in the current ring buffer and the journal query when you need retained records from an earlier boot; neither is a universal replacement for the other.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Redmond desk20 min
    How to create a link to File or Folder in Windows 11Windows 11 gives you several ways to point to a file or folder without moving or duplicating it. You can create a desktop shortcut,…
Recommended PC Tool
Recommended PC Tool
Windows Errors? Fix Them Before They SpreadFree repair scan
Crashes, No Sound, or Screen Glitches?Free driver scan

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.