How can I have grep not print out 'No such file or directory' errors?

后端 未结 9 1012
情书的邮戳
情书的邮戳 2020-11-28 19:06

I\'m grepping through a large pile of code managed by git, and whenever I do a grep, I see piles and piles of messages of the form:

> grep pattern * -R -         


        
9条回答
  •  天命终不由人
    2020-11-28 19:40

    If you are grepping through a git repository, I'd recommend you use git grep. You don't need to pass in -R or the path.

    git grep pattern
    

    That will show all matches from your current directory down.

提交回复
热议问题