awk重复行 awk只输出文本中重复的行 root@bwhhkle:~# cat xx 1xm 1xm 2 3ytd 3ytd 4 root@bwhhkle:~# awk 'a[$0]++' xx 1xm 3ytd 输出重复的行和重复行的总数 root@bwhhkle:~# awk '{a[$0]++}END{for(i in a)print a[i],i}' xx 1 4 2 1xm 2 3ytd 1 2 Tags: awk, awk详解 Read more articles Previous Postawk偶数行 Next Postawk偶数行二 You Might Also Like exec详解 March 9, 2017 curl方式执行shell脚本时如何传参 May 6, 2015 awk奇数行二 March 18, 2016