cli.fail

Practice this fail.

Duplicates, now adjacent.

Linux · Restart as often as you like

Read the error, choose a command, and learn
why it works. Nothing runs on your machine.

Browse all practice ↗

Linux · Intermediate

tags.txt contains duplicate full lines in arbitrary order. Produce sorted unique output using one GNU sort command; leave the file unchanged.

Duplicates, now adjacent.

$ uniq tags.txt

blue red blue

How do you deduplicate lines regardless of their original position?

3 attempts remaining

Read why this fix works

Duplicates, now adjacent.

sort -u tags.txt

sort -u orders the lines and outputs one representative of each equal group. Unlike uniq on unsorted input, it can remove duplicates that started far apart.

Practice rounds do not affect the daily score or local streak. Try today’s challenge, or choose another scenario.

Copy your result