I have this file:
hello 1
hello 2
world 1
world 2
hello 3
hi 3
hi 4
I want to sort this like so,
hello 1
hi 3
world 1
The thing is I need only the first unique item in column 1.
I tried sort -k1 -u file.txt
but it isn't working as I expect. How do I go about this?