% perl -ne 'push @a, $_; $h{$_}++; END { print for grep $h{$_}==1, @a }' foo.txt