How to count the occurrences of a number?

I have a file, consisting of a column of numbers, some of which are the same, I want to count the occurrences of each unique number, here is the simple way:

cat filename | sort | uniq -c

Be sure that the numbers are in a column.

posted on 2014-11-06 12:18  wujingcqu  阅读(166)  评论(0编辑  收藏  举报