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

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

September 3rd, 2009

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

Bill Uncategorized

  1. No comments yet.
  1. No trackbacks yet.