Bird
0
0

Identify the error in this pipeline command:

medium📝 Debug Q14 of 15
Linux CLI - Pipes and Redirection
Identify the error in this pipeline command:
cat file.txt | grep 'error' | | sort
Asort command cannot be used with pipes
BMissing filename after cat
Cgrep command is misspelled
DExtra pipe symbol causes syntax error
Step-by-Step Solution
Solution:
  1. Step 1: Check the pipeline syntax

    The command has two pipe symbols | | in a row, which is invalid syntax.
  2. Step 2: Validate other parts

    cat file.txt is correct, grep 'error' is correct, and sort can be used with pipes.
  3. Final Answer:

    Extra pipe symbol causes syntax error -> Option D
  4. Quick Check:

    Double pipes cause syntax errors in pipelines [OK]
Quick Trick: Look for consecutive pipes causing syntax errors [OK]
Common Mistakes:
  • Ignoring extra pipe and blaming grep or cat
  • Thinking sort can't be piped
  • Assuming missing filename error

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Linux CLI Quizzes