shell 实现word count

awk '{arr[$2]+=$1}END{for (i in arr) print i,arr[i]}' sort_all.txt | sort -k2nr -g

posted @ 2015-05-16 18:53  wq920  阅读(360)  评论(0编辑  收藏  举报