我怎样才能让grep不打印'没有这样的文件或目录'错误? [英] How can I have grep not print out 'No such file or directory' errors?

查看:316
本文介绍了我怎样才能让grep不打印'没有这样的文件或目录'错误?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



<$ p

$ p> > grep模式* -R -n
任何/ .git / svn:没有这样的文件或目录



<有什么办法可以让这些线路消失? > - no-messages 标志来压制错误。


-s,--no-messages抑制错误消息




  grep模式* -s -R -n 


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?

解决方案

You can use the -s or --no-messages flag to suppress errors.

-s, --no-messages suppress error messages

grep pattern * -s -R -n

这篇关于我怎样才能让grep不打印'没有这样的文件或目录'错误?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆