This came in handy when I needed to change the IP address used in several links on a customer's site. I simply specified the path to all the web files, and ran a command similar to the one below.
find /path/to/directory -name "*.txt" | xargs perl -pi -e 's/stringtoreplace/replacementstring/g'
Note that you can change *.txt
to just *
to search inside all files. Also keep in mind the replacement command will be completed recursively (files nested inside directories will also be searched).
This was exactly what I was looking for. Thank you!
You’re welcome! I’m glad I could help. 🙂
Thank U Man. U save me a lot of time -> U’re the best! )
My pleasure! I’m glad I was able to help. 🙂