sort排序 awk去重

#按字段1排序,按字段2去重 
sort -k1.1 $logfilepath | awk '!a[$2]++{print}' > outtestfileby2.log 
#按字段1排序,按字段1去重 
sort $logfilepath | awk '!a[$1]++{print}' > $outfilepath 

#超简单的根据字段1来去重,但不排序 
cat $logfilepath | awk '!a[$1]++' > $outfilepath

 

posted @ 2013-04-15 10:40  明之道  阅读(1314)  评论(0编辑  收藏  举报