Search and Replace with Perl

# Sometimes you need to change something in a bunch of files at once.
# These are some command-line ways of doing that.

# For universal replacement (in all files down from the current directory):
find ./ -type f -exec perl -pi -e \'s/stringtofind/stringtoreplacewith/g\' {} ;

# To do all ".php"s, for example:
find ./ -type f -name *.php -exec perl -pi -e \'s/stringtofind/stringtoreplacewith/g\' {} ;

# To find/replace in just the present directory:
perl -pi -e \'s/stringtofind/stringtoreplacewith/g\