shell 实现word count

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

原文地址:https://www.cnblogs.com/wq920/p/4508380.html