Find all files with a ".txt" extension in the current directory and its subdirectories, and replace all occurrences of "old" with "new" in each file.
find ~ -type f -iname '*.txt' -exec sed -i 's/old/new/g' '{}' \;