Search and replace with perl pie

A search and replace across many files using Perl can be as simple as:

perl -p -i -e 's/foo/bar/g' files

files can be a list of files, or a shell glob etc (*.txt etc).

Only really useful for one-liner replacements.

Other references

perl/searchreplace.txt · Last modified: 2010/02/26 10:45 (external edit)
Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki