Bird
0
0

Why does the command ps -ef | grep produce an error?

medium📝 Debug Q6 of 15
Linux CLI - Process Management
Why does the command ps -ef | grep produce an error?
ABecause <code>grep</code> cannot be used with <code>ps</code>
BBecause <code>ps -ef</code> is an invalid option
CBecause the pipe symbol is misplaced
DBecause <code>grep</code> requires a search pattern argument
Step-by-Step Solution
Solution:
  1. Step 1: Analyze the command

    ps -ef lists all processes; piping to grep filters output.
  2. Step 2: Identify the error

    grep requires a pattern to search for; missing pattern causes error.
  3. Final Answer:

    A -> Option D
  4. Quick Check:

    grep needs a pattern [OK]
Quick Trick: grep always needs a pattern argument [OK]
Common Mistakes:
  • Thinking ps -ef is invalid
  • Assuming pipe is incorrect
  • Believing grep can't be used with ps

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Linux CLI Quizzes