find . -name "/data26/billold/chenyj/log/count_sms_later.log" -prune -o -print . ./count_sms_later.log ./count_sms_later.log/abc ./count_sms_later.log/abc/ccd ./count_sms_later.log.070914 ./count_sms_later.log.070918 ./count_sms_later.log.070928 我用了-prune 应该不会出现./count_sms_later.log/abc ./count_sms_later.log/abc/ccd 小菜鸟求教啊
by amcyj - HP-UX - 2008-05-18 22:51:14 阅读(1867) 回复(4)
-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
想要查询/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...
把小于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...
各位,在find命令中,里面的-prune参数可以忽略查找指定的目录,可是我在用该命令遇到如下问题,请各位指点一下,谢谢 # find /root/Desktop/ -path "/root/Desktop/tmp/" -prune -o -print /root/Desktop/ /root/Desktop/shredder.desktop /root/Desktop/trash.desktop /root/Desktop/mycomputer.desktop /root/Desktop/My Documents /root/Desktop/My Documents/RCA.cer /root/Desktop/My Documents/.directory /root/Desktop/t...
[root@rh9 test]# pwd /test [root@rh9 test]# mkdir -p d1/d2/d3 [root@rh9 test]# touch ff [root@rh9 test]# touch d1/ff [root@rh9 test]# touch d1/d2/ff [root@rh9 test]# touch d1/d2/d3/ff [root@rh9 test]# mkdir new.d [root@rh9 test]# touch new.d/ff [root@rh9 test]# find . -name ff ./d1/d2/d3/ff ./d1/d2/ff ./d1/ff ./ff ./new.d/ff [root@rh9 test]# find . -name "/test/new.d" -prune -name ff [root@rh9 tes...
条件:目录/abcde下有a、b、c、d、e五个子目录 ①现在希望在/abcde目录下查找文件123,但不希望在/abcde/a下查找 使用find /abcde -name 123 "/abcde/a" -prune -o -print行吗? 应该怎么用呢? ②现在希望在/abcde目录下查找文件123,但不希望在/abcde/a和/abcde/b下查找 使用find /abcde -name 123 "/abcde/a /abcde/b" -prune -o -print行吗? 应该怎么用呢? 请高手指导啊!谢谢!