• grep find string in files by type, and display file name, matched line number
grep -n -r oldtext --include "*.php" .
  • grep and sed to replace string in files by type, modified original file backup it to .bak
grep -rl oldtext --include "*.php" . | xargs sed -i.bak 's/oldtext/newtext/g'
除额外注明的地方外,本维基上的内容按下列许可协议发布: CC Attribution-Share Alike 4.0 International