I have a hierarchy of directories containing many text files. I would like to search for a specific text line every time it appears in one of the files, and replace it with another line. For example, I can replace each occurrence of the string "Coke" with "Pepsi". Does anyone know how to do this? I am wondering if there is some kind of Bash command that can do this without loading all of these files into the editor or without creating a more complex script to do this.
I found this page explaining the trick with sed, but it does not work on files in subdirectories.
source
share