Grep through files and replace

Want to replace recursively http://example.co.uk with http://10.0.0.7 and also create backups of the files modified:

grep -rFl “http://www.example.co.uk” /path¬† | xargs sed -i.bak ‘s/http:\/\/www.example.co.uk/http:\/\/10.0.0.7/g’

This entry was posted in Linux and tagged , , . Bookmark the permalink.

Leave a Reply

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