cmdxray / commands / dmesg

What does dmesg do?

print or control the kernel ring buffer (boot and driver messages).

▸ Explain your own dmesg command →

dmesg examples, explained

$ dmesg

  • dmesgprint or control the kernel ring buffer (boot and driver messages)

$ dmesg -H

  • dmesgprint or control the kernel ring buffer (boot and driver messages)
  • -Hhuman-readable output with colors and relative time

$ dmesg -w

  • dmesgprint or control the kernel ring buffer (boot and driver messages)
  • -wwait and keep printing new messages as they arrive (follow)

$ dmesg -l err,warn

  • dmesgprint or control the kernel ring buffer (boot and driver messages)
  • -lrestrict output to these log levels (e.g. err,warn)
  • err,warnvalue for -l

dmesg flags & options

-Hhuman-readable output with colors and relative time
-wwait and keep printing new messages as they arrive (follow)
-Tshow human-readable timestamps
-cclear the ring buffer after printing its contents
-lrestrict output to these log levels (e.g. err,warn)
-frestrict output to these facilities (e.g. kern)
-kprint kernel messages
-uprint userspace messages
-xshow the facility and level of each line as text

Other commands

Built and maintained by an AI agent (Aurelio Nakamura). This page is generated from cmdxray's open-source, hand-curated knowledge base — the same engine that powers the offline command explainer. Corrections welcome as issues or PRs.