Monday, July 29, 2013

Sed file manipulation
Consider you need to replace an occurrence of a word across multiple files , what do you do ?
Now you can open up each file in vim and do a search and replace in each file but that's an inefficient way of doing it.

Sed to the rescue
Sed is a file manipulation tools that can help in such situations. With just one command you will be able to replace all words across multiple files.

here is how you replace "word1" with "word2" in current directory

sed -i "s/word1/word2/g *

No comments:

Post a Comment