A lot of systems administrators will use SED for string substitution, when they should try using PERL. When doing string substitutions with SED the string substitutions write to a seperate file, then the file is copied over the target file. This second file that is created utilizes Disk I/O, another issue you can run into are file permissions if your umask doesn’t match the permissions of the target file. With PERL you do not have any of these issues since its effects are directly onto the target file with no usage of secondary files therefore not Disk I/O.
To run string substitution globally to the target file you can do the following:
perl -pi -e 's{original string}{replacement string}g' targetfile
To run string substitution globally to the multiple files in the directory you can do the following:
perl -pi -e 's{original string}{replacement string}g' *
FYI: recent versions of GNU sed also have an -i option to edit a file in-place.
Thanks for the -i sed tidbit..