Command line

Various command line wizardry:

Search and replace text recursively in all files in a directory and its subdirectories:

Use

find . -type f -name '*.txt' -exec sed -i '' s/this/that/g {} +

This assumes you want to replace 'this' with 'that' in all files with the extension .txt. It is case-sensitive. The last 'g' means to do it more than once per line if needed ("globally").

Courtesy https://stackoverflow.com/questions/9704020/recursive-search-and-replace-in-text-files-on-mac-and-linux

Keywords: find/replace folder subfolder subfolders subdirectory