I am working on writing some scripts to grep certain directories, but these directories contain all sorts of file types.
grep
I want to grep jus
I am aware this question is a bit dated, but I would like to share the method I normally use to find .c and .h files:
tree -if | grep \\.[ch]\\b | xargs -n 1 grep -H "#include"
or if you need the line number as well:
tree -if | grep \\.[ch]\\b | xargs -n 1 grep -nH "#include"