2019年1月22日 星期二

Find duplicate lines in a file and count how many time each line was duplicated?

https://stackoverflow.com/questions/6712437/find-duplicate-lines-in-a-file-and-count-how-many-time-each-line-was-duplicated

Assuming there is one number per line:
sort  | uniq -c
You can use the more verbose --count flag too with the GNU version, e.g., on Linux:
sort  | uniq --count

沒有留言: