find replace string within subdirectories linux code example
Example 1: linux replace string in files recursively
find . -type f -name "*.txt" -exec sed -i'' -e 's/foo/bar/g' {} +
Example 2: linux replace string in all files
sed -i 's/old-text/new-text/g' input.txt