nerdexam
LPI

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.

The Linux Operating System

Question

What is true about the dmesg command? (Choose two correct answers.)

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)
  • A
    2% (1)
  • C
    94% (50)
  • D
    4% (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.

AIt traces the execution of a command and shows each step the program carries out.

Tracing the execution steps of a command is the function of `strace`, not `dmesg`.

BIt sends messages to the command lines of all current user sessions.

Broadcasting messages to all currently logged-in user terminals is performed by the `wall` command, not `dmesg`.

CIt displays the content of the Linux kernel's ring buffer.Correct

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.

DIt immediately outputs all new messages written to the system journal.

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).

EIt might not display older information because it was overwritten by newer information.Correct

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

#dmesg#kernel ring buffer#system logs

Community Discussion

No community discussion yet for this question.

Full 010-160 Practice