如何搜尋特定字串且只印出一行? - Linux
By Enid
at 2012-01-02T11:18
at 2012-01-02T11:18
Table of Contents
假設搜尋檔案內容如下
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 但是好像沒辦法跑出我要的結果
可否請好心的大大給點指引 感謝
--
Tags:
Linux
All Comments
By Tristan Cohan
at 2012-01-07T02:59
at 2012-01-07T02:59
By Gary
at 2012-01-11T09:43
at 2012-01-11T09:43
By Jacky
at 2012-01-15T13:26
at 2012-01-15T13:26
By Eden
at 2012-01-18T14:32
at 2012-01-18T14:32
By Jake
at 2012-01-22T00:29
at 2012-01-22T00:29
By Regina
at 2012-01-26T20:11
at 2012-01-26T20:11
By Victoria
at 2012-01-28T21:04
at 2012-01-28T21:04
By Daniel
at 2012-01-30T03:44
at 2012-01-30T03:44
By Jake
at 2012-02-04T01:10
at 2012-02-04T01:10
By Joe
at 2012-02-04T18:22
at 2012-02-04T18:22
By Mason
at 2012-02-08T05:43
at 2012-02-08T05:43
By Hardy
at 2012-02-11T13:51
at 2012-02-11T13:51
By Lauren
at 2012-02-13T15:17
at 2012-02-13T15:17
By David
at 2012-02-17T06:29
at 2012-02-17T06:29
By Ida
at 2012-02-17T12:25
at 2012-02-17T12:25
By Catherine
at 2012-02-18T16:51
at 2012-02-18T16:51
By Tom
at 2012-02-23T02:06
at 2012-02-23T02:06
By Una
at 2012-02-26T16:20
at 2012-02-26T16:20
Related Posts
推薦安裝linux測試用的低階主機
By Faithe
at 2012-01-01T23:04
at 2012-01-01T23:04
裝在USB隨身碟 是不是比較慢?
By Damian
at 2012-01-01T21:10
at 2012-01-01T21:10
請問關於linux檔案權限問題,謝謝!
By Anonymous
at 2012-01-01T08:25
at 2012-01-01T08:25
HIME 和 Ubuntu
By Daniel
at 2012-01-01T00:50
at 2012-01-01T00:50
cnetos 6.2在 vmware player 跑不起來
By Caitlin
at 2011-12-31T23:09
at 2011-12-31T23:09