Small and powerful command to find and substitute the old_phrase with the new_phrase in
all files and directories recursively with the sed command on GNU/Linux
find . -type f -print0 | xargs -0 sed -i 's/old_phrase/new_phrase/g'
Attention! The previous command finds files also in the hidden folders and if you’re working with Subversion or GIT you’d like to skip them. The following keys -not -path '*/\.*' do the trick
find . -not -path '*/\.*' -type f -print0 | xargs -0 sed -i 's/old_phrase/new_phrase/g'
For MacOS users the command would be (note the sed -i '')
find . -not -path '*/\.*' -type f -print0 | xargs -0 sed -i '' 's/old_phrase/new_phrase/g'
Note. MacOS ships the BSD sed. In GNU/Linux you run the GNU sed. More about it https://stackoverflow.com/questions/7573368/in-place-edits-with-sed-on-os-x.
And check out a beautiful visual explanation of shell commands.