010-160 · Question #8
What is true about the dmesg command? (Choose two correct answers.)
The correct answer is C. It displays the content of the Linux kernel's ring buffer. E. It might not display older information because it was overwritten by newer information. The dmesg command reads the Linux kernel ring buffer, which stores boot-time and hardware-related messages but can lose older entries when the buffer fills up.
Question
Options
- AIt traces the execution of a command and shows each step the program carries out.
- BIt sends messages to the command lines of all current user sessions.
- CIt displays the content of the Linux kernel's ring buffer.
- DIt immediately outputs all new messages written to the system journal.
- EIt might not display older information because it was overwritten by newer information.
How the community answered
(53 responses)- A2% (1)
- C94% (50)
- D4% (2)
Why each option
The `dmesg` command reads the Linux kernel ring buffer, which stores boot-time and hardware-related messages but can lose older entries when the buffer fills up.
Tracing the execution steps of a command is the function of `strace`, not `dmesg`.
Broadcasting messages to all currently logged-in user terminals is performed by the `wall` command, not `dmesg`.
The `dmesg` command reads and prints the contents of the kernel ring buffer, a fixed-size circular memory structure maintained by the Linux kernel that holds messages from the kernel itself, including hardware detection, driver initialization, and system events.
Continuously following and outputting new messages written to the systemd journal is done with `journalctl -f`, not `dmesg` (though `dmesg -w` can follow the kernel ring buffer specifically).
Because the kernel ring buffer is a fixed-size circular buffer, once it is full, new messages overwrite the oldest entries, meaning that early boot messages or older kernel events may no longer be visible when `dmesg` is run on a system that has been running for a long time.
Concept tested: Linux kernel ring buffer access with dmesg
Source: https://man7.org/linux/man-pages/man1/dmesg.1.html
Topics
Community Discussion
No community discussion yet for this question.