去除重复行 sort file |uniq
查找非重复行 sort file |uniq -u
查找重复行 sort file |uniq -d
统计 sort file | uniq -c
格式如:
1:[2019-04-11 17:17:17] 321331(8090) add 1 tem
cat test.txt |tail -n +1 |sed 's/]/ ]g' |awk '{count[$3]+=1}END{for(key in count) if (count[key]>1) print key" "count[key]}' >> result.txt
>是写文件,前面的内容会消失
>>是添加内容