A very simple solution: replace in all *.txt
files in folder string_1
with string_2
:
sed -i 's/string_1/string_2/g' *.txt
https://askubuntu.com/questions/84007/find-and-replace-text-within-multiple-files
Here I use sed to replace every occurrence of the word “cybernetnews” with “cybernet” in every file with the extension, c, in the directory, /home/user/directory/.
A more generic variation where you search recursively from the directory of execution and operate on only regular, readable, writeable files:
|