bash find and replace through files in a folder 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: find and replace in all files in directory centos
grep -rl 'apples' /dir_to_search_under | xargs sed -i 's/apples/oranges/g'