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

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

问题描述

当我 grep 我的 Subversion 工作副本目录时,结果包括 .svn 目录中的许多文件.是否可以递归 grep 目录,但排除 .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?

推荐答案

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

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

grep --exclude-dir=".svn"

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

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天全站免登陆