Master Linux Boot Logs: How to Use dmesg to Inspect and Manage System Messages
Learn how to display, filter, and clear Linux kernel boot messages using the dmesg command, understand its options such as -c, -n, -r, and -s, and see practical examples for checking system startup, disk, and memory information.
dmesg: Display Boot Information
Use the dmesg command to show system boot messages. The kernel stores these messages in a ring buffer, also saved in /var/log/dmesg . Drivers and hardware modules print information that can be viewed with dmesg.
Command Syntax
dmesg [options]Option Meanings
The options are:
-c – display messages then clear the ring buffer.
-n <level> – set the logging level.
-r – print the raw message buffer.
-s <size> – set buffer size (default 8196 bytes).
Examples
(1) Show all boot messages # dmesg (2) View basic disk information # dmesg | grep sda (3) View basic memory information # dmesg | grep memory (4) Clear the dmesg ring buffer
# dmesg -cSigned-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
Open Source Linux
Focused on sharing Linux/Unix content, covering fundamentals, system development, network programming, automation/operations, cloud computing, and related professional knowledge.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
