Simple Sed examples
Use sed to replace old strings with new strings in a file:
sed ‘s/old_string/new_string/’ file > newfile
mv newfile file
or, if you are willing to live slightly dangerously, replace the file directly:
sed -i “” ‘s/old_string/new_string/’ file
If you want to replace all occurences of old_string, you need to use “g”
sed -i “” ‘g/old_string/new_string/’ file