Tuesday, March 28, 2017

sed command example


sed - stands for stream editor.

So, you wish to replace a string in a file.

Example:

sed -ie 's/few/asd/g' hello.txt

Here, 
 
-i in place
 
-e expresssion - here for making use of s/ which is search
 
g - global , to change in the whole line.
 

source:
http://unix.stackexchange.com/questions/159367/using-sed-to-find-and-replace

No comments:

Post a Comment