Find all files with the extension ".txt" in the current directory and up to 4 levels of subdirectories, and list the names of the files that contain the string "foo".
find / -maxdepth 4 -name "*.txt" -exec grep -li "foo" {} \;