Inspect device detection and driver initialization messages produced during boot.
Display the kernel ring buffer.
Which command is appropriate?
dmesg reads the kernel ring buffer and shows hardware detection and driver initialization messages.
Detailed explanation
lastIncorrect. last shows login and reboot records.
Incorrect. last shows login and reboot records.
whoIncorrect. who lists logged-in users.
Incorrect. who lists logged-in users.
uptimeIncorrect. uptime reports system uptime and load averages.
Incorrect. uptime reports system uptime and load averages.
dmesgCorrect. dmesg displays the kernel ring buffer.
Correct. dmesg displays the kernel ring buffer.
Try it yourself
An example you can run in a temporary verification environment.
dmesg | headExpected result
カーネルメッセージ。セキュリティ設定により一般ユーザーの読み取りが拒否される場合があるKey points
- dmesg reads kernel messages
- The buffer can include post-boot messages
- Read access may be restricted
Notes
- Environment: Linux / util-linux dmesg
- Command output formatting can vary slightly by distribution or tool version.
- Run the example in a temporary directory or process when possible.
Foundation review
Read the scope first
Check whether the command acts on the current shell, a new process, an existing process, or a file.
Verify the observable result
Use the supplied command and compare the output with the expected result.