The sort command lets me put lines in alphabetical order and remove duplicate lines. I need something similar that can sort the words on a single line, put them
awk '{for(i=1;i<=NF;i++) a[$i]++} END{for(i in a) printf i" ";print ""}' INPUT_FILE
Test:
[jaypal:~/Temp] cat file
zebra ant spider spider ant zebra ant
[jaypal:~/Temp] awk '{for (i=1;i<=NF;i++) a[$i]++} END{for (i in a) printf i" ";print ""}' file
zebra spider ant