In order to search for a particular file named "test.txt" in /home directory, use
find /home -name "test.txt" -printSearch all the .txt files in /home directory, use
find /home -name "*.txt" -printif you want to search for a string through all the files .txt files, there are two ways
find /home -name "*.txt" -exec grep -q "string-to-be-searched" '{}' \; -print
find /home -name "*.txt" | xargs grep "string-to-be-searched"second one is more fast and efficient. Removal of -q in the first command will output the text segment where the specified string is. If you want to search all files for the string, just remove -name "*txt" option.