Bird
0
0

Why is stdin redirection (<) preferred over passing a filename as an argument for some commands?

hard📝 Conceptual Q10 of 15
Linux CLI - Pipes and Redirection
Why is stdin redirection (<) preferred over passing a filename as an argument for some commands?
ABecause it allows commands to read input from any source, not just files
BBecause it always runs commands faster
CBecause it prevents commands from writing output
DBecause it automatically creates the input file if missing
Step-by-Step Solution
Solution:
  1. Step 1: Understand stdin redirection flexibility

    Using < lets commands read input from files or other sources like pipes, not just filenames.
  2. Step 2: Compare with passing filename as argument

    Passing filename as argument limits input to that file; < allows more flexible input handling.
  3. Final Answer:

    Because it allows commands to read input from any source, not just files -> Option A
  4. Quick Check:

    stdin redirection increases input flexibility [OK]
Quick Trick: Use < to flexibly feed input from files or other sources [OK]
Common Mistakes:
  • Thinking it speeds up commands
  • Believing it blocks output
  • Assuming it creates files automatically

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Linux CLI Quizzes