Bird
0
0

You run cat missingfile 2> errors.log but errors.log remains empty. What is the likely mistake?

medium📝 Debug Q14 of 15
Linux CLI - Pipes and Redirection
You run cat missingfile 2> errors.log but errors.log remains empty. What is the likely mistake?
AYou redirected stdout instead of stderr.
BThe command ran successfully with no errors.
CYou used <code>2>></code> instead of <code>2></code>.
DThe file <code>missingfile</code> actually exists.
Step-by-Step Solution
Solution:
  1. Step 1: Check if error occurs

    If missingfile exists, cat produces no error, so nothing is sent to errors.log.
  2. Step 2: Understand empty error file

    Since no error happened, the error file remains empty despite redirection.
  3. Final Answer:

    The command ran successfully with no errors. -> Option B
  4. Quick Check:

    No error means empty error file [OK]
Quick Trick: Empty error file means no error occurred [OK]
Common Mistakes:
  • Assuming 2>>> is valid syntax
  • Confusing stdout and stderr redirection
  • Ignoring that file might exist

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Linux CLI Quizzes