Skip to main content
1 of 2
dogbane
  • 30.8k
  • 17
  • 85
  • 61

Try:

find . -name "*.php" -exec sed -i "s/$pattern/$replacement/g" {} \; 

where pattern is the pattern to search for and replacement is the text to replace it with.

The -i option for sed edits the files "in place". If you want to create a backup of the file before you edit it, use -i'.bak'.

dogbane
  • 30.8k
  • 17
  • 85
  • 61