This page looks plain and unstyled because you're using a non-standard compliant browser. To see it in its best form, please upgrade to a browser that supports web standards. It's free and painless.

修性不修命,萬劫陰靈難入聖; 修命不修性,猶有家財無主柄
Album | Blog | Comment | Profile | Control Panel
aquatower | 30 March,2009 14:02
Bookmark: HemiDemi MyShare Baidu Google Bookmarks Yahoo! My Web Del.icio.us Digg technorati furl Bookmark to:YouPush Bookmark to:你推我報

(1)man 輸出文字檔
#man 指令|col -b > filename.txt
ex: sed指令輸出到文字檔
#man sed|col -b >sed.txt

(2)awk
#awk '{pattern}' filename
ex: 印出第三欄資料
#netstat -a|awk '{print $3}'

(3)sed
#sed 'pattern' filename
ex:
(1)將1到4列刪除
#sed '1,4d' filename
(2)含有la的列刪除
#sed '/la/d' filename
(3)正規表示式{含有3個數字刪除}
#sed '/[0-9]\{3\}/d' filename
----------

(4)含有la的列印出{-n 是抑制預設秀出全部的動作}
#sed -n '/la/p' filename
(5)取代la換成qoo
#sed -n 's/la/qoo/p' filename


Comment

Trackback

Comment Permissions: Only members may comment. If you are not a PIXNET member, click here to sign up.