Difficulty: Easy
Correct Answer: -d option
Explanation:
Introduction / Context:
When extracting fields with cut, the utility must know how to split each line. The delimiter can be a comma, tab, colon, or any single character. Choosing and declaring the correct delimiter is essential for accurate column extraction.
Given Data / Assumptions:
Concept / Approach:
The -d option to cut sets the field delimiter. For example, -d ',' uses a comma; -d ':' uses a colon. Without -d, cut defaults to tab for field mode. Pair -d with -f to pick specific fields. Other letters shown here (-a, -r, -x) are not valid delimiter switches for cut.
Step-by-Step Solution:
Verification / Alternative check:
Print a sample line and visually count separators to ensure that the -d character matches the actual data; otherwise you will see empty or misaligned fields in output.
Why Other Options Are Wrong:
Common Pitfalls:
Using multi-character delimiters (unsupported by cut) or forgetting to quote special shell characters such as '|' or '*' if used as delimiters in unusual cases.
Final Answer:
-d option
Discussion & Comments