How can I exclude directories from grep -R?

前端 未结 13 2210
感动是毒
感动是毒 2020-12-04 04:11

I want to traverse all subdirectories, except the \"node_modules\" directory.

13条回答
  •  醉话见心
    2020-12-04 05:00

    If you are grepping for code in a git repository and node_modules is in your .gitignore, you can use git grep. git grep searches the tracked files in the working tree, ignoring everything from .gitignore

    git grep "STUFF"
    

提交回复
热议问题