Perl search and replace string. I use the following script to replace all occurrences of oldstring with newstring in all of the files in your current directory.
perl -p -i -e 's/oldstring/newstring/g' *
How do I replace in sub-directories as well?
Perl search and replace string. I use the following script to replace all occurrences of oldstring with newstring in all of the files in your current directory.
perl -p -i -e 's/oldstring/newstring/g' *
How do I replace in sub-directories as well?
Use Perl and Find as following. Perl before find or find before perl doesn't matter.
or
find ./ -exec perl -p -i -e ’s/oldstring/newstring/g’ {} \;Tony
Post your Answer