Search and replace multiple files
May 1st, 2009
No comments
In the example below we are replacing every occurrence of mama with papa in all .html files in current path using Perl.
perl -pi -e "s/mama/papa/g;" *.html
We do the same thing here but make a copy of original file for backup.
perl -pi -e.bak "s/mama/papa/g;" *.html
Categories: Tips & Tricks
Recent Comments