Bird
0
0

What will be the output of the command dmesg | grep -i error?

medium📝 Command Output Q4 of 15
Linux CLI - System Administration
What will be the output of the command dmesg | grep -i error?
AAll kernel messages containing the word 'error' (case-insensitive)
BOnly error messages from user applications
CA syntax error due to wrong grep usage
DNo output, because dmesg does not support grep
Step-by-Step Solution
Solution:
  1. Step 1: Understand piping dmesg to grep

    Piping dmesg output to grep filters kernel messages matching the pattern.
  2. Step 2: Analyze grep -i error

    The -i flag makes grep case-insensitive, so it matches 'error' or 'Error'.
  3. Final Answer:

    All kernel messages containing the word 'error' (case-insensitive) -> Option A
  4. Quick Check:

    dmesg | grep -i error filters kernel errors [OK]
Quick Trick: Pipe dmesg to grep -i to find errors ignoring case [OK]
Common Mistakes:
  • Thinking grep filters user logs, not kernel
  • Assuming syntax error with grep
  • Believing dmesg cannot be piped

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Linux CLI Quizzes