免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 5451 | 回复: 3
打印 上一主题 下一主题

如何让find命令跳过某个目录进行查询? [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2008-12-22 21:59 |只看该作者 |倒序浏览
比如我用find命令在/目录下查找文件aaa,但又不希望在/export中进行查找,请问使用哪个参数?完整的命令是什么?谢谢

论坛徽章:
0
2 [报告]
发表于 2008-12-22 22:56 |只看该作者
man find

Example 3: Printing all file names but skipping SCCS  direc-
     tories  Recursively print all file names in  the  current  directory
     and below, but skipping SCCS directories:

     example% find . -name SCCS -prune -o -print

     Example 4: Printing all file names and  the  SCCS  directory
     name

     Recursively print all file names in  the  current  directory
     and  below,  skipping  the contents of SCCS directories, but
     printing out the SCCS directory name:

     example% find . -print -name SCCS -prune

好好研究一下,看是否符合你的要求,我E问太菜了

论坛徽章:
0
3 [报告]
发表于 2008-12-23 19:53 |只看该作者
你的例子确实是跳过了某个文件夹,但其中并没有搜索某个文件的例子。
可能find确实没有这个功能。
谢了!

论坛徽章:
0
4 [报告]
发表于 2008-12-24 09:48 |只看该作者

回复 #3 ctkstarcraft 的帖子

你看这样行不,find . -name SCCS -prune -o  -name filename -print
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP