Find all files in the current directory and its subdirectories, execute the grep command to search for the pattern, and print the files that contain the pattern.
find ~ -type f -exec grep -q 'pattern' {} \+ -print