Search and replace on the command line
echo "THIS IS A STRING TO REPLACE" >> file.txt
sed -i.bak "s/STRING TO REPLACE/REPLACED STRING/g" file.txt
rm file.txt.bak
cat file.txt
# THIS IS A REPLACED STRING
echo "THIS IS A STRING TO REPLACE" >> file.txt
sed -i.bak "s/STRING TO REPLACE/REPLACED STRING/g" file.txt
rm file.txt.bak
cat file.txt
# THIS IS A REPLACED STRING