Replacing all occurences of a string in a file with another
In Linux, replacing all instances of a string with another string is easy thanks to sed. A simple example is as follows:
To replace the string foo with the string bar in all .txt files: