Source (VBird)
範例說明 :
透過 sed 將 /etc/pure-ftpd/pure-ftpd.conf 中含有 Anonymous 字串的每一行都列印出來, 並且濾掉註解行 (#開頭) 與空白行 :
linux-tl0r:~ # cat /etc/pure-ftpd/pure-ftpd.conf | grep 'Anonymous' | sed 's/^#.*//g' <將有 'Anonymous' 字串行 grep 出來後, 透過 sed 濾掉 註解行>
AnonymousOnly no
NoAnonymous no
AnonymousCanCreateDirs yes
AllowAnonymousFXP no
<有空白行出現>
AnonymousCantUpload no
linux-tl0r:~ # cat /etc/pure-ftpd/pure-ftpd.conf | grep 'Anonymous' | sed 's/^#.*//g' \ <使用 '\' 換行編輯>
> | sed '/^$/d'
AnonymousOnly no
NoAnonymous no
AnonymousCanCreateDirs yes
AllowAnonymousFXP no
AnonymousCantUpload no <成功濾出含有 'Anonymous' 字串的行數並排除註解行與空白行!!!>
This message was edited 3 times. Last update was at 03/10/2010 22:32:43
沒有留言:
張貼留言