摘要: 假如有如下保存url的文件all_urls:http://www.baidu.comhttp://www.sina.comhttp://www.baidu.comhttp://www.sohu.comhttp://www.baidu.comhttp://www.sina.com想统计不同url出现的次数,并按照从大到小的顺序排列,只需一行简单的shell脚本就可以了:cat all_urls|sort|uniq -c |sort -k1 -nr|awk '{print $2}'结果如下:http://www.baidu.comhttp://www.sina.comhttp:// 阅读全文
posted @ 2012-09-20 17:49 刘浩de技术博客 阅读(821) 评论(2) 推荐(1) 编辑