Tagged: perl

Find (search) and replace text from command line in multiple files (Linu

- by admin

Another (and more easy) way to change text in multiple files is to use grep:
grep -lr -e 'oldtext' * | xargs sed -i 's/oldtext/newtext/g'

or to use PERL:
perl -p -i -e ’s/oldtext/newtext/g’ *

 

« All tags