linux统计相关命令学习



linux统计相关命令学习
 
1.找到符合条件的行grep,egrep:
   www.2cto.com  
2.提取有价值的信息,扔掉无用信息cut:
如用双引号做分隔符,取第二段:cut -d\" -f2 file
 
3.对行进行处理sed:
如替换每行hello为空:sed 's/hello//g' file (s后面的符号表示分隔符)
 
4.脚本编程高级统计awk:
   www.2cto.com  
5.按照行排序sort
 
6.行统计wc,uniq:
如统计行数wc -l
如统计不重复行数:sort file|uniq -uc(-u表示唯一,-c表示统计)
如统计重复行数:sort file|uniq -dc(-d表示重复,-c表示统计)
 

相关内容

    暂无相关文章