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

后端 未结 7 1912
故里飘歌
故里飘歌 2020-12-04 10:40

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. T

7条回答
  •  清歌不尽
    2020-12-04 11:09

    It works for the same purpose, but without --include option. It works on grep 2.5.1 as well.

    grep -v -E ".*\.(html|htm|php)"
    

提交回复
热议问题