ChinaUnix.net
相关文章推荐:

find prune

find . \( -path .*/Input -o -path .*/Output -o -path .*/Current \) -prune -o -name "*.htm" -print 像这样的find 不期望的是跳过Input,Output, Current的目录进行检索 但是 正则不起作用 请问 怎么弄

by luyi1983 - Shell - 2009-11-13 17:30:33 阅读(2368) 回复(9)

相关讨论

-prune If the current entry is a directory, cause find to skip that directory. This can be useful to avoid walking certain directories, or to avoid recursive loops when using cpio -p. Note, however, that -prune is useless if ...

by kenancola - Shell - 2007-09-21 08:46:35 阅读(2068) 回复(5)

问大家一个find的低级问题,我以前遇到这个问题到现在也没解决。 我想查找/目录下的所有目录,但不包括/proc如何做到 ? find / -type d -path "/proc" -prune -o -print 结果并不是我想的那样 我系统为rh9,kernel2.6.12

by sting0z - Shell - 2005-08-15 13:26:21 阅读(5714) 回复(6)

[code][root@vhost1 a]# ls -R . .: a b ./b: a [root@vhost1 a]# find . -path './b' -prune -o -type f ./b ./a [root@vhost1 a]# find . -path './b' -prune ./b[/code]能否利用短路方式给分解一下,讲讲执行过程,谢谢,实在是糊涂了

by aaa103439 - Shell - 2014-01-03 11:57:04 阅读(2944) 回复(9)

目录结构 ./templates/ ./templates/Makefile ./templates/Makefile.mk ./test ./test/Makefile ./test/...... //other files 1. # find . -path "./test" -prune -o -print 这个是对的 输出结果: ./templates/Makefile ./templates/Makefile.mk 2. # find . -name "Makefile" -path "./test" -prune -o -print 这个为什么显示所有的文件呢??? 输出结果: ./templates/Makefil...

by jesionchen - Shell - 2011-09-09 10:43:45 阅读(1788) 回复(3)

想要查询/root/xz下除了/root/xz/xz2目录下的所有.txt文档 find /root/xz -name "*.txt" -path "/root/xz/xz2" -prune -o -print 上述命令哪里错了?

by 落音 - Shell - 2009-06-19 23:42:09 阅读(1902) 回复(5)

把小于1000k的文件打包,但排除 tmp目录。试用了下面很多种方法,还是不行。总是把tmp目录下的文件打进去。那位前辈帮忙看下,那出的问题。谢了 solaris 8 [code] find . -name tmp -prune -o -size -1000k -exec tar rvf a.tar {} \; find . \( -name tmp -prune -o -size -1000k \) -exec tar rvf a.tar {} \; find . \( -name tmp -prune \) -o -size -1000k -exec tar rvf a.tar {} \; find . -name tmp -prune -o -size -100...

by ddb521 - Shell - 2009-05-19 21:31:21 阅读(1660) 回复(7)

比如要在/usr/sam目录下查找不在dir1子目录之内的所有文件 find /usr/sam -path "/usr/sam/dir1" -prune -o -print find [-path ..] [expression] 在路径列表的后面的是表达式 -path "/usr/sam" -prune -o -print 是 -path "/usr/sam" -a -prune -o -print 的简写表达式按顺序求值, -a 和 -o 都是短路求值,与 shell 的 && 和 || 类似如果 -path "/usr/sam" 为真,则求值 -prune , -prune 返回真,与逻辑表达式为真;否则不求值 -...

by hndeng06 - Linux文档专区 - 2009-11-08 23:01:43 阅读(579) 回复(0)

把小于1000k的文件打包,但排除 tmp目录。试用了下面很多种方法,还是不行。总是把tmp目录下的文件打进去。那位前辈帮忙看下,那出的问题。谢了 [code] find . -name tmp -prune -o -size -1000k -exec tar rvf a.tar {} \; find . \( -name tmp -prune -o -size -1000k \) -exec tar rvf a.tar {} \; find . \( -name tmp -prune \) -o -size -1000k -exec tar rvf a.tar {} \; find . -name tmp -prune -o -size -1000k -exec ta...

by ddb521 - Solaris - 2009-05-19 11:43:05 阅读(1089) 回复(0)

把小于1000k的文件打包,但排除 tmp目录。试用了下面很多种方法,还是不行。总是把tmp目录下的文件打进去。那位前辈帮忙看下,那出的问题。谢了\r\n[code]\r\nfind . -name tmp -prune -o -size -1000k -exec tar rvf a.tar {} \\;\r\nfind . \\( -name tmp -prune -o -size -1000k \\) -exec tar rvf a.tar {} \\;\r\nfind . \\( -name tmp -prune \\) -o -size -1000k -exec tar rvf a.tar {} \\;\r\nfind . -name tmp -prune -o...

by ddb521 - Solaris - 2009-05-19 11:43:05 阅读(2845) 回复(0)

linux find -prune -name -wholename -regex -exec -exec command {} + ; 1.find 命令的格式 find [全局选项][要搜索的的文件夹]表达式 其中每个表达式又依由三部分组成: 局部选项(option),测试(test),命令(action).这三部分之间都用逻辑操作符(operator)与或非连接起来.操作符可以省略,这时候就用默认的"与"来连接.表达式可以多个,表达式之间也用逻辑操作符连接. 2.find 命令的执行过程 [全局选项][要搜索的的文件夹]容易理解,难...

by cleverd - Linux文档专区 - 2008-10-31 15:56:22 阅读(1617) 回复(0)