I recently wrote a script that does a sed command, to replace all the occurrences of \"string1\" with \"string2\" in a file named \"test.txt\".
It looks like this: