Perl Search and Replace File Entries

Published by Torry Crass on

Have you ever wanted to replace a string across multiple files and haven't been exactly sure how to manage it?  Well, as it turns out Perl offers a really quick option for doing just that.
 
perl -p -i -e ’s///g’ *
 
modify * to yourfiles.* or *.configs to select various files.  You can also replace the -i with -i.bak to generate backup files while it's changing your originals.

0 Comments

Leave a Reply