-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 ...
问大家一个find的低级问题,我以前遇到这个问题到现在也没解决。 我想查找/目录下的所有目录,但不包括/proc如何做到 ? find / -type d -path "/proc" -prune -o -print 结果并不是我想的那样 我系统为rh9,kernel2.6.12
[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]能否利用短路方式给分解一下,讲讲执行过程,谢谢,实在是糊涂了
目录结构 ./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...
想要查询/root/xz下除了/root/xz/xz2目录下的所有.txt文档 find /root/xz -name "*.txt" -path "/root/xz/xz2" -prune -o -print 上述命令哪里错了?
把小于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...
比如要在/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 返回真,与逻辑表达式为真;否则不求值 -...
把小于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...
把小于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...
linux find -prune -name -wholename -regex -exec -exec command {} + ; 1.find 命令的格式 find [全局选项][要搜索的的文件夹]表达式 其中每个表达式又依由三部分组成: 局部选项(option),测试(test),命令(action).这三部分之间都用逻辑操作符(operator)与或非连接起来.操作符可以省略,这时候就用默认的"与"来连接.表达式可以多个,表达式之间也用逻辑操作符连接. 2.find 命令的执行过程 [全局选项][要搜索的的文件夹]容易理解,难...