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.
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.
转载于:https://www.cnblogs.com/wujingcqu/p/4078413.html