标签:
(1)统计文件中出现次数最多的前10个单词
#ps -ef > ps.file
#cat ps.file | awk ‘{print $1}’ | sort | uniq -c | sort -n -r -k1 | head -10
(2)输出至少出现3次的的单词
# cat ps.file | awk ‘{print $1}‘ | sort | uniq -c | sort -n -r -k1 | awk ‘{if ($1 > 3){print $0} }‘
标签:
原文地址:http://www.cnblogs.com/Berryxiong/p/5914507.html