Perform a replacement on multiple files
find /my_folder -name "*.php" -exec sed -i "s/search/replacement/g" {} \;
And some explanations :
/my_folder
the directory where to search (recursively).
-name "*.php"
the files I want to process.
-exec a_command \;
means I want to execute
command on each file found. In this example, the command is a_command
, the sed -i "s/search/replacement/g" {}
parameter will be replaced by the name of each file found.{}