Using find and sed to replace strings in multiple files

This is self-explanatory!

find . -type f -exec sed -i 's/oldstr/newstr/g' {} ;

We used to replace ‘/wp-content/uploads’ with ‘/files’ while merging single wordpress-sites into a big multisite setup.

find . -type f -exec sed -i 's/\/wp-content\/uploads/\/files/g' {} ;

For more details

Discuss your project
with our experts

No obligation. Limited slots.

Contact Form Business Enquiry

"*" indicates required fields

Please attach any RFP, project specification, or document that you would like to share.
Drop files here or
Max. file size: 5 GB.
    This field is for validation purposes and should be left unchanged.