Challenge - 5 Problems
Kernel Message Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
💻 Command Output
intermediate2:00remaining
What does this dmesg command output?
You run the command
dmesg | grep usb on a Linux system. What kind of output should you expect?Linux CLI
dmesg | grep usb
Attempts:
2 left
💡 Hint
Think about what dmesg shows and what grep does when filtering for 'usb'.
✗ Incorrect
The dmesg command shows kernel messages. Using grep usb filters these messages to show only those related to USB devices, like connection or disconnection logs.
🧠 Conceptual
intermediate2:00remaining
Why use dmesg instead of checking /var/log/messages for kernel logs?
Which reason best explains why you might prefer using
dmesg to view kernel messages instead of reading the /var/log/messages file?Attempts:
2 left
💡 Hint
Think about how dmesg accesses kernel messages compared to log files.
✗ Incorrect
dmesg reads the kernel ring buffer directly, showing the latest kernel messages immediately. Log files like /var/log/messages may have delays or be rotated.
📝 Syntax
advanced2:00remaining
Which command correctly shows the last 10 kernel messages using dmesg?
You want to see only the last 10 lines of kernel messages using dmesg. Which command will do this correctly?
Attempts:
2 left
💡 Hint
Remember that dmesg outputs all messages and you can pipe it to other commands.
✗ Incorrect
dmesg outputs all kernel messages. Using the pipe to 'tail -10' shows only the last 10 lines. The other options are invalid or do not exist.
🔧 Debug
advanced2:00remaining
What error occurs with this dmesg command?
You run the command
dmesg --follow to watch kernel messages live, but it returns an error. What is the likely cause?Linux CLI
dmesg --follow
Attempts:
2 left
💡 Hint
Check if the dmesg version supports the option you used.
✗ Incorrect
Not all dmesg versions support the '--follow' option. If unsupported, it returns an unrecognized option error.
🚀 Application
expert3:00remaining
How to filter dmesg output for kernel warnings and save to a file?
You want to save all kernel warning messages from dmesg to a file named
warnings.log. Which command does this correctly?Attempts:
2 left
💡 Hint
Use grep to filter text output for keywords.
✗ Incorrect
dmesg does not have a --level option. Using grep -i warning filters lines containing 'warning' case-insensitively and redirects output to a file.