假設搜尋檔案內容如下
2012/01/02 1830 xxx [email protected] testing
2012/01/02 1940 aaa [email protected] testing2
2012/01/01 1720 eee [email protected] testing3
2012/01/02 1740 yyy [email protected] testing4
我要以第四欄做排序 也就是帳號那一欄
並且每個帳號只要印出一行即可
整理完如下
2012/01/02 1830 xxx [email protected] testing
2012/01/01 1720 eee [email protected] testing3
目前我可以用sort將帳號那欄先做排序
但是不知道接下來可以用什麼指令去挑出單獨的一行呢?
有試過uniq 但是好像沒辦法跑出我要的結果
可否請好心的大大給點指引 感謝
--
2012/01/02 1830 xxx [email protected] testing
2012/01/02 1940 aaa [email protected] testing2
2012/01/01 1720 eee [email protected] testing3
2012/01/02 1740 yyy [email protected] testing4
我要以第四欄做排序 也就是帳號那一欄
並且每個帳號只要印出一行即可
整理完如下
2012/01/02 1830 xxx [email protected] testing
2012/01/01 1720 eee [email protected] testing3
目前我可以用sort將帳號那欄先做排序
但是不知道接下來可以用什麼指令去挑出單獨的一行呢?
有試過uniq 但是好像沒辦法跑出我要的結果
可否請好心的大大給點指引 感謝
--
All Comments