Awk/Sed: How to do a recursive find/replace of a string?
Awk/Sed: How to do a recursive find/replace of a string?
I am trying to replace specific text within several files (maybe around 200 files). Is there a way that I could this without having to replace the text manually.
I am actually trying to change the IPs in several httpd.conf, eg. 192.168.0.5 to 192.168.0.10. I have googled and some of the sites suggested using grep and awk, but no specific help was found by me.
Any help is greatly appreciated. Thanks.
sed 's/original_string/new_string/' file1 file2 file3 ...
You can do
If the strings contain the character / you can use any other character
for delimiter.
On second thought this will send all the output to the screen.
So I guess you should do
and repeat this for every file you want changed.
Read »Category: Tags: