Find all files with the extension .txt in the current directory and its subdirectories, and search for the string "pattern" in them, printing out the names of the files that contain it.
find . -name '*.txt' | xargs grep -irl "pattern"