本文介绍了我怎样才能让 grep 不打印“没有这样的文件或目录"错误?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在搜索由 git 管理的一大堆代码,每当我执行 grep 时,我都会看到成堆的消息:
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 -n
whatever/.git/svn: No such file or directory
有什么办法可以让这些线条消失?
Is there any way I can make those lines go away?
推荐答案
您可以使用 -s
或 --no-messages
标志来抑制错误.
You can use the -s
or --no-messages
flag to suppress errors.
>
-s, --no-messages 抑制错误信息
grep pattern * -s -R -n
这篇关于我怎样才能让 grep 不打印“没有这样的文件或目录"错误?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!