XK0-006 System Management Practice Question
A technician wants to extract the third column of a tab-separated file and sort the output uniquely. Which three commands can be combined using pipes to achieve this? (Choose three.)
Answer choices
Why each option matters
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
✓
cut -f3
Option A, `cut -f3`, is correct because `cut` with the `-f3` flag extracts the third field from each line, and with tab as the default delimiter it directly targets the third column of a tab-separated file. Option D, `sort`, is correct because it orders the extracted lines so that duplicate values become adjacent, which is a prerequisite for `uniq` to collapse them. Option E, `uniq`, is correct because it removes adjacent duplicate lines, producing the unique output the technician wants when chained after `sort`. Option B, `tee`, is not appropriate because it merely splits output to a file and standard output rather than extracting or deduplicating data. Option C, `wc -l`, is not appropriate because it only counts lines and does not extract or sort columns.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✓
cut -f3
Why this is correct
`cut -f3` extracts the third tab-delimited field, satisfying the column-selection requirement. Its default delimiter is TAB, matching the tab-separated file, so no `-d` flag is needed. Piped into `sort` and `uniq`, it produces the uniquely sorted output the technician wants.
- ✗
tee
Why it's wrong here
tee duplicates its input to a file and standard output; it neither selects a field nor removes duplicates, so the third column is never isolated. It is tempting as a pipeline utility, but it is correct when you must capture intermediate output while continuing to pass data downstream.
- ✗
wc -l
Why it's wrong here
wc -l counts newline characters, producing a single number instead of the third column's unique values. It is tempting because it is a common pipeline command, yet it is correct when the goal is tallying lines, not extracting and de-duplicating a field.
- ✓
sort
Why this is correct
Piping extracted fields into `sort` orders them lexically, and its `-u` flag removes duplicate lines, satisfying the unique-sort constraint. Combined with `cut -f3` for the tab-separated third column, `sort` completes the pipeline, though `sort -u` alone also deduplicates without needing a separate `uniq`.
- ✓
uniq
Why this is correct
Piping sorted output into `uniq` collapses adjacent duplicate lines, satisfying the unique-sort constraint. Because `uniq` only removes repeats that are contiguous, it must follow `sort`; combined with `cut -f3` to extract the third tab-separated field, the pipeline yields distinct values.
Go deeper
Related to this question
About these practice questions
One of 781 original XK0-006 practice questions on Courseiva, each with a full explanation and wrong-answer analysis — not exam dumps or protected exam content. Learn why practice questions differ from exam dumps →
JA
Written by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
This XK0-006 practice question is part of Courseiva's free CompTIA certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the XK0-006 exam.