September 11, 2013
Using an editor it is very easy to find and replace all occurrences of a string within the file you are editing. Some editors even make it relatively easy to find and replace a string in all files within a project or set of files. However when the number of files grows to dozens or hundreds or even thousands, using an editor may not be the most efficient solution.
It is very simple to accomplish the same find and replace on the command line using the Unix
command coupled with the
A variation on this command would be
You could even use
xargs for the command.
If you want to see a list of the files containing either the source or target string, you can use
Read the friendly man page for
grep for more information.