Say I have a file like:
apple pear lemon lemon pear orange lemon
How do I make it so that I only keep the unique lines, so I get:
Use GNU sort utility:
sort -u file.txt
If you're on Windows and using Git, then sort and many more useful utilities are already here: C:\Program Files\Git\usr\bin\
Just add this path to your %PATH% environment variable.