cat sorttest | sort | uniq -c | sort -k1
sorttest内容如下:
linux-文件中行按照出现次数多少排序
原文:http://www.cnblogs.com/DengGao/p/line_number_sort.html