One of my friend was in urgent need for a find and replace command in set of files of some specific extension and asked me if i have one.
I gave him the following: Hope this is useful for you.
find . -name "*.extension " -exec sed -i s/strtofind/strtoreplace/g '{}' \;
where,
Note: Please take caution when you want to find and replace strings having "/". You may need to use \\/ to make sure that "/" is treated as string by the sed command.
No comments:
Post a Comment