1. 程式人生 > >uniq 去除重複行或統計

uniq 去除重複行或統計

不對比第一欄位<13>Aug
[[email protected] root]# tail -5 install.log.syslog |uniq -f 1
<13>Aug 21 16:01:28 kudzu: aliased usb-controller1 as ehci-hcd
<13>Aug 21 16:01:29 kudzu: aliased usb-controller1 as ehci-hcd
<13>Aug 21 16:01:20 kudzu: aliased usb-controller1 as ehci-hcd
<13>Aug 22 16:01:20 kudzu: aliased usb-controller1 as ehci-hcd
不對比第二欄位21
[
[email protected]
root]# tail -5 install.log.syslog |uniq -f 2
<13>Aug 21 16:01:28 kudzu: aliased usb-controller1 as ehci-hcd
<13>Aug 21 16:01:29 kudzu: aliased usb-controller1 as ehci-hcd
<13>Aug 21 16:01:20 kudzu: aliased usb-controller1 as ehci-hcd
不對比第二欄位 16:01:28
[[email protected]
root]# tail -5 install.log.syslog |uniq -f 3
<13>Aug 21 16:01:28 kudzu: aliased usb-controller1 as ehci-hcd
[[email protected] root]# tail -5 install.log.syslog |uniq -f 4
<13>Aug 21 16:01:28 kudzu: aliased usb-controller1 as ehci-hcd