Replacing text with sed
To replace all occurences of string1 in a file with string2 :
$ sed -ri "s|string1|string2|" some_file.txt
To replace all occurences of string1 in a file with string2 :
$ sed -ri "s|string1|string2|" some_file.txt
If you enjoyed this post, please follow us on twitter or subscribe to our feed!