Find all files in the current directory (and its subdirectories) whose name matches the pattern '*.*', search for the string 'pattern' in those files, and compress the files that contain the string into a tarball located at /tmp/result.tgz.
find . -iname '*.*' | xargs grep -l 'pattern' | xargs tar zcf /tmp/result.tgz