统计一个文件中前两列字符(字符串出现的次数并从大到小排序) 源文本内容如下: 统计结果如下:
cat test.txt | awk -F" " '{for(i=1; i<=2; i++) {print $i}}' | sort | uniq -c | sort -nr