osx yosemite - uniq does not clean out duplicate entries -


i have file number on each line. trying find out distinct set of numbers. below excerpt:

 550  400  4000  400  1900  550  5000  400  1500  1900  5000  4000  5000  1900  5000 

passing through uniq, however, doesn't clean out duplicates. number of lines reduced 256 699, there still multiple lines 400 or 550, etc.

i generated file python script, know fact on each line there blank followed number, , followed \n. @ least that's printing within code.

i not understand wrong file. why uniq not working thought would?

(os x yosemite, python 2.7)

you need sort contents before calling uniq, or use sort -u.

from uniq man page:

uniq - report or omit repeated lines

note how says repeated , not duplicate.