Bird
0
0

Why does the command sort < produce an error?

medium📝 Debug Q7 of 15
Linux CLI - Pipes and Redirection
Why does the command sort < produce an error?
ABecause sort cannot read from stdin
BBecause no input file is specified after <
CBecause < is used for output redirection
DBecause sort requires an argument before <
Step-by-Step Solution
Solution:
  1. Step 1: Understand the role of < in commands

    < redirects input from a file, so it must be followed by a filename.
  2. Step 2: Identify missing filename error

    sort < without a filename causes an error because input source is missing.
  3. Final Answer:

    Because no input file is specified after < -> Option B
  4. Quick Check:

    Missing filename after < causes error [OK]
Quick Trick: Always specify a file after < for input redirection [OK]
Common Mistakes:
  • Thinking sort can't read stdin
  • Confusing < with output redirection
  • Assuming argument needed before <

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Linux CLI Quizzes