Zend certified PHP/Magento developer

Searching for a string in a specified file extension with conditions

I’m currently grepping a directory looking for a specific string that is only present in .txt files. However, I’d like to expand my grep to only return values where the directory contains specific file type. For example, my existing grep:

`grep -R abc1234 –include=*.txt’

But I’d want to limit my return results to only include directories that contain, for example, pdfs.