Skip navigation
All People > SHAWN WALSH > SHAWN WALSH's Blog > 2014 > November > 11

If you are not a Unix guru, you may not know about the power of sed and string manipulation.

This tool can come in very handy when you need to replace a string in all files in a directory.



sed -i 's/old-word/new-word/g' *.txt


below I change to https and port 8443


sed -i 's/http:\/\/MACHINENAME:8080\//https:\/\/MACHINENAME:8443\//g' *


This is less error prone than manually editing multiple files. It can also be scripted.


If you are using Windows, there are versions of 'sed'  you can download.