Results 1 to 1 of 1
Hello,
I think this is a simple question.
I am trying come up with a Linux command that does a search and replace for all files containing a string that ...
- 09-01-2009 #1Just Joined!
- Join Date
- Sep 2009
- Posts
- 1
Linux search and replace using sed and regex
Hello,
I think this is a simple question.
I am trying come up with a Linux command that does a search and replace for all files containing a string that starts with a string and ends with a string. example:
looking in all files to replace a string that starts with <a href... and ends with </a> and replace it with Hello World
so <a href = "file.html">File</a> would become Hello World.
I am currently using find /folder/folder/ -type f -exec sed -i 's/old/new/g' {} \;
but looks for a specific string.
any help would save me hours or possibly days of manual work.


Reply With Quote