grep specific filetypes on MAC
grep --include=*.js -R . --color=auto setHeader
Since the example given uses "file type = file extension", this should just work.
The best way to do that is to combine the find
and the grep
command:
find . -name "*.js" -exec grep --color=auto setHeader {} \;