Find all files ending with ".txt" in the current directory and its subdirectories, and replace all occurrences of "xyz" with "abc" in each of those files.
find ~ -name "*.txt" -exec sed -i 's/xyz/abc/g' {} \;