Find all files with the extensions .txt or .sh in any directory and its subdirectories, and replace the string "search" with "replace" in each file.
find / -depth -type f -iname "*.txt" -o -iname "*.sh" | xargs sed -i 's/search/replace/'