Bird
0
0

Why does the cut command with -f option sometimes skip lines in the output when used with -s?

hard📝 Conceptual Q10 of 15
Linux CLI - Text Processing
Why does the cut command with -f option sometimes skip lines in the output when used with -s?
ABecause -s selects only the first field
BBecause -s sorts the output lines
CBecause -s suppresses lines without the delimiter
DBecause -s shows only lines with empty fields
Step-by-Step Solution
Solution:
  1. Step 1: Understand the -s option

    The -s option tells cut to suppress lines that do not contain the delimiter.
  2. Step 2: Effect on output lines

    Lines without the delimiter are skipped, so they do not appear in output.
  3. Final Answer:

    Because -s suppresses lines without the delimiter -> Option C
  4. Quick Check:

    -s suppresses lines missing delimiter [OK]
Quick Trick: Use -s to skip lines missing delimiter [OK]
Common Mistakes:
  • Thinking -s sorts output
  • Assuming -s selects fields
  • Confusing -s with silent mode

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Linux CLI Quizzes