find指令+grep用法一

. 2009年4月23日 星期四
  • Agregar a Technorati
  • Agregar a Del.icio.us
  • Agregar a DiggIt!
  • Agregar a Yahoo!
  • Agregar a Google
  • Agregar a Meneame
  • Agregar a Furl
  • Agregar a Reddit
  • Agregar a Magnolia
  • Agregar a Blinklist
  • Agregar a Blogmarks
Bookmark and Share

find /usr/local/ -name "*.php" -exec grep -l 'function do_action' {} \;

/usr/local 要尋找的路徑
*.php 要尋找的檔案類型
-exec 找到符合的檔案後接著執行那個指令
-l 顯示檔路路徑
function do_action 檔案內容有這個keyword的檔名

0 意見: