Wednesday, May 16, 2012

how do I use the grep --include option for multiple file types?

When I want to grep all the html files in some directory, I do the following

grep --include="*.html" pattern -R /some/path

which works well. The problem is how to grep all the html,htm,php files in some directory?

From this post, it seems that I can do the following

grep --include="*.{html,php,htm}" pattern -R /some/path

But sadly, it would not work for me.

FYI, my grep version is 2.5.1.

No comments:

Post a Comment