How can I print only those lines that appear exactly once in a file? E.g., given this file:
mountain forest mountain eagle
The output would
You almost had the answer in your question:
sort filename | uniq -u