Find all files with a name ending in ".txt" in the current directory and its subdirectories, and search for the string "pattern" in those files, suppressing any error messages.
find ~ -iname '*.txt' | xargs grep -s 'pattern'