April 27, 2017 | 5:10 am
You are here:  / HOWTO / [HOWTO] Linux – Multiple file search and replace

[HOWTO] Linux – Multiple file search and replace

perl -pi -w -e ‘s/search/replace/g;’ *.php

-p loop
-i means edit in-place
-w write warnings
-e means execute the following line of code.

for example:

I want to replace every instance of #FFF in multiple style sheets with #000:

$ perl -pi -w -e 's/\#FFF/\#000/g;' *.css

That simple
initrd

[ad#ad-1]