歡迎您光臨本站 註冊首頁

對一個文件顯示雙單詞

←手機掃碼閱讀     火星人 @ 2014-03-08 , reply:0
1,首先有一個文件data
tao@debian6:~$ cat data
hello hello about is
is is are you ok be
yes no NO are are
jerry jerry jerry JERRY
She's my girlfriend

2,創建一個管道線,顯示所有的雙單詞,如hello hello
tao@debian6:~$ cat data | tr -cs [:alpha:]\' "\n" |uniq -c |grep 2|awk '{print $2}'
hello
are

本文出自 「jerrymin」 博客,請務必保留此出處http://jerrymin.blog.51cto.com/3002256/852486


[火星人 ] 對一個文件顯示雙單詞已經有370次圍觀

http://coctec.com/docs/linux/show-post-45839.html