Ask your WordPress questions! Pay money and get answers fast! Comodo Trusted Site Seal
Official PayPal Seal

how to find and replace actual file in Debian WordPress


I have about 75 websites that all have a php file in their WordPress theme directory. Let's say it's called sub-header.php.

I need to find and replace all of the existing sub-header.php file with a new one. Not strings of text within, but the actual file.

Anyone know how to do this? Thanks!

Answers (2)


Ian Lincicome answers:

Just go into your root directory where the new file is and run this:
find . -name "sub-header.php" -print -exec cp sub-header.php {} \;
Tested and working on Debian;-)

Kyler Boudreau comments:

Thanks Ian - this one worked.


Rempty answers:

Maybe this can help you

find . -name "sub-header.php" -exec cp ~/mynewfile.php {} \;

mynewfile.php must be located in your home directory

Kyler Boudreau comments:

Rempty - thanks, but it didn't work for me.