Bird
0
0

You run the command cut -f 1,3 -d ':' file.txt but get no output. What is the most likely reason?

medium📝 Debug Q14 of 15
Linux CLI - Text Processing
You run the command cut -f 1,3 -d ':' file.txt but get no output. What is the most likely reason?
AThe file is empty
BThe file uses spaces instead of ':' as delimiter
CThe fields 1 and 3 do not exist in the file
DThe cut command does not support multiple fields
Step-by-Step Solution
Solution:
  1. Step 1: Check possible causes for no output

    cut produces no output if there are no lines to process.
  2. Step 2: Evaluate the most likely cause

    A wrong delimiter produces modified output (whole lines with tabs), not empty. Fields 1 always exists, multiple fields supported. Empty file causes truly no output.
  3. Final Answer:

    The file is empty -> Option A
  4. Quick Check:

    Empty file -> no output [OK]
Quick Trick: Verify input file has content before debugging [OK]
Common Mistakes:
  • Assuming delimiter mismatch causes no output
  • Thinking cut fails if fields missing
  • Believing cut can't handle multiple fields

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Linux CLI Quizzes