Replace a particular word in a file shell script - sed

How to replace a particular word in a file.

Single command :
sed "s/rama/krish/g" "a.txt" > b && rm -f a.txt && mv b a.txt
Here the above command replaces the word "rama" by "krish" in the file a.txt

To see a complete shell script see this.


Post a Comment

Who ever writes Inappropriate/Vulgar comments to context, generally want to be anonymous …So I hope U r not the one like that?
For lazy logs u can at least use Name/URL option which don’t even require any sign-in, good thing is that it can accept your lovely nick name also and URL is not mandatory too.
Thanks for your patience
~Best job portal admin(I love "Transparency")