Bird
0
0

Find the problem in this pipeline:

medium📝 Debug Q7 of 15
Linux CLI - Pipes and Redirection
Find the problem in this pipeline:
ls -l | grep 'txt' | sort |
APipeline ends with a pipe, causing syntax error
Bgrep command missing quotes
Csort command is invalid
Dls command missing argument
Step-by-Step Solution
Solution:
  1. Step 1: Analyze pipeline end

    Pipeline ends with a pipe symbol but no command after it, causing syntax error.
  2. Step 2: Check other commands

    grep has quotes, sort is valid, ls -l works without extra argument.
  3. Final Answer:

    Pipeline ends with a pipe, causing syntax error -> Option A
  4. Quick Check:

    Pipe must be followed by a command [OK]
Quick Trick: Never end a pipeline with a pipe symbol alone [OK]
Common Mistakes:
  • Leaving trailing pipe
  • Forgetting quotes in grep
  • Misunderstanding sort usage

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Linux CLI Quizzes