$ echo -e "foo\nbar\nfoo" | uniq foo bar foo $ echo -e "foo\nbar\nfoo" | sort | uniq bar foo $