Find all files with a ".txt" extension in the current directory and its subdirectories, and replace all occurrences of "old" with "new" in those files.
find ~ -iname '*.txt' | xargs sed -i 's/old/new/g'