Replace text in multiple files

Using find and sed a text in multiple files can be replaced using a one liner. If you have GIT bash you can do it in Windows too.

In the example below address of old.server.com will be replaced with new.server.com in all Web.config files.

find /c/inetpub/wwwroot -name "Web.config" -exec sed -i 's/old.server.com/new.server.com/g' {} +

Leave a Reply

Your email address will not be published. Required fields are marked *