Linux/Ubuntu grep a directory for a word. The quick version.

The explanationless version:

find ./ -name "my_file_mask" | xargs grep -i my_search_term

Thus, if I’m searching for the word “pork” in all files:

find ./ | xargs grep -i pork

Or if I’m searching for pork in all “.budget” files:

find ./ -name "*.budget" | xargs grep -i pork

Leave a Reply

Your email address will not be published. Required fields are marked *