Find all the .php files in the current directory and below, and replace FROM with TO. find . -type f -iname '*.php' -exec sed -i 's/FROM/TO/g' {} \;