Search and replace in multiple files

To search a directory for files with the extension .conf and replace the IP address 213.161.99.99 with 213.161.91.99. Do the following:

find . -name '*.conf' | xargs perl -pi -e 's/213.161.99.99/213.161.91.99/g'

Thats it have fun.

Leave a Reply

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.