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.

2 years 15 weeks ago
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.
You can use Perl and Find as following:
in lieu of writing to a tmp file and moving it afterwards to the original file, do an in-place edit:
You might want to combine it with find as this:
Post Comment