An administrator needs to combine two sorted text files, /tmp/a.txt and /tmp/b.txt, into a single sorted stream on standard output while also removing duplicate lines that appear in both files. Which command should be used?
Passing both files as arguments to sort merges them into one input stream, and -u suppresses duplicate lines after sorting. Because the input files are already sorted, the result is a single ordered stream with duplicates from either file removed, which is exactly the stated goal.
Why this answer
Sorting both files together with duplicate suppression yields the union of their lines in order, which matches the request. Merge mode preserves duplicates, uniq cannot read two inputs and would clobber the second path, and comm -12 returns only the shared lines, so none of those alternatives produce the required combined, deduplicated stream.
Exam trap
The trap here is assuming uniq can accept two files and merge them, when its second argument is an output file.