c'e' un comando:

uniq - report or omit repeated lines


man uniq