统计文件中字符出现次数假设文件(test.txt)内容如下:
1
1
2
2
3
3
4
要求结果显示:
2 1
2 2
2 3
1 4
说明:第一列为字符串出现的频率,第二列为字符串内容,
- uniq -c test.txt
- sort test.txt | uniq -c | sort -nr
- awk '{p[$1] += 1}END{for(a in p) print p[a],"\t",a}' file
2 1
2 2
2 3
1 4
按出现次数大小排序
- awk '{p[$1] += 1}END{for(a in p) print p[a],"\t",a}' test.txt|sort -nr
本日志由 flyinweb 于 2010-01-27 14:20:16 发表,目前已经被浏览 3845 次,评论 0 次;
引用通告:http://www.517sou.net/Article/405/Trackback.ashx
It is quite useful and interesting too.
VIRT 的上限是64G,也就是36位, cat /proc/cpuinfo的结果是:addre
昨天要准备用线程重写webbench,试验了下Fedora Linux 2.6.35.14
不明白您的具体的意思是什么?
已经发送到你QQ邮箱
http://www.2mysite.net/scriptencoder/screnc.asp 站长你好,看
你好,我发现一个问题,就是从mysqld2同步过来的数据,在mysqld1的
晕,我说是怎么回事情,原来我和你一样,忘记设置了活动分区