从grep中排除.svn目录 [英] Exclude .svn directories from grep

查看:105
本文介绍了从grep中排除.svn目录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我在我的Subversion工作副本目录下grep时,结果包含很多来自.svn目录的文件。是否可以递归地grep一个目录,但从.svn目录中排除所有结果?

如果你有GNU Grep,它应该像这样工作:

  grep --exclude-dir =。svn

如果碰巧在没有GNU Grep的Unix系统上,请尝试以下操作:

  grep -R无论你喜欢什么* | grep -v\.svn / *


When I grep my Subversion working copy directory, the results include a lot of files from the .svn directories. Is it possible to recursively grep a directory, but exclude all results from .svn directories?

解决方案

If you have GNU Grep, it should work like this:

grep --exclude-dir=".svn"

If happen to be on a Unix System without GNU Grep, try the following:

grep -R "whatever you like" *|grep -v "\.svn/*" 

这篇关于从grep中排除.svn目录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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