As an aside I once found out you can replace 'sort | uniq' entirely with an obscure awk command so long as you don't require the output to be sorted. Iirc it performs twice as fast.
cat file.txt | awk '!x[$0]++' cat file.txt | awk '!x[$0]++'