HOWTO : Use find and grep together

If you ever wanted to search for a particular text in certain types of files in Linux, you can use the following combo of find and grep

find / -name \*.xml -type f | xargs grep -i “text_to_search”

I used *.xml (note the \ before *) as the mask in the filename to look for all XML files.. then I piped this to grep using xargs.

A colleague pointed out that I can do the same by using

grep -r o-i “text_to_speech”