谁会用find命令中的 -prune 参数?

谁会用find命令中的 -prune 参数?

我想从根目录开始查找一个文件名叫abc的文件,但排除/var这个目录,这个命令应该如何写?      
find / "abc" -prune /var      
不行,报错:
find: paths must precede expression
Usage: find [path...] [expression]
还是格式不对。      
进入/var目录,然后再
find / -name "abc" -prune
-prune是不查当前目录。      
不对,我试了:


[root@F_server etc]# find / -name "host*" -prune
/proc/sys/kernel/hostname
find: /proc/31597: No such file or directory
find: /proc/31598: No such file or directory
find: /proc/31601: No such file or directory
/usr/bin/hostid
/usr/bin/hoststat
/usr/bin/host
/usr/lib/perl5/5.6.0/Net/hostent.pm
/usr/lib/perl5/5.6.0/hostname.pl
/usr/share/doc/mrtg-2.9.6/contrib/mrtgmk/cfg/hosts.cfg
/usr/share/man/man1/hostname.1.gz
/usr/share/man/man1/hostid.1.gz
/usr/share/man/man1/host.1.gz
/usr/share/man/man3/hosts_access.3.gz
/usr/share/man/man5/hosts.allow.5.gz
/usr/share/man/man5/hosts.deny.5.gz
/usr/share/man/man5/hosts_access.5.gz
/usr/share/man/man5/hosts_options.5.gz
/usr/share/man/man5/host.conf.5.gz
/usr/share/man/man5/hosts.equiv.5.gz
/usr/share/man/man5/hosts.5.gz
/usr/share/licq/utilities/hostname.utility
/usr/X11R6/lib/X11/config/host.def
/etc/sysconfig/networking/profiles/default/hosts
/etc/host.conf
/etc/hosts.allow
/etc/hosts.deny
/etc/hosts
/etc/hosts.bak
/bin/hostname
/lib/modules/2.4.7-10/kernel/drivers/net/wan/hostess_sv11.o
[root@F_server etc]#      
我也想知道!      
[QUOTE]最初由 superasp 发布
[B]不对,我试了:


[root@F_server etc]# find / -name "host*" -prune
/proc/sys/kernel/hostname
find: /proc/31597: No such file or directory
find: /proc/31598: No such file or directory
find: /proc/31601: No such file or directory
/usr/bin/hostid
/usr/bin/hoststat
/usr/bin/host
/usr/lib/perl5/5.6.0/Net/hostent.pm
/usr/lib/perl5/5.6.0/hostname.pl
/usr/share/doc/mrtg-2.9.6/contrib/mrtgmk/cfg/hosts.cfg
/usr/share/man/man1/hostname.1.gz
/usr/share/man/man1/hostid.1.gz
/usr/share/man/man1/host.1.gz
/usr/share/man/man3/hosts_access.3.gz
/usr/share/man/man5/hosts.allow.5.gz
/usr/share/man/man5/hosts.deny.5.gz
/usr/share/man/man5/hosts_access.5.gz
/usr/share/man/man5/hosts_options.5.gz
/usr/share/man/man5/host.conf.5.gz
/usr/share/man/man5/hosts.equiv.5.gz
/usr/share/man/man5/hosts.5.gz
/usr/share/licq/utilities/hostname.utility
/usr/X11R6/lib/X11/config/host.def
/etc/sysconfig/networking/profiles/default/hosts
/etc/host.conf
/etc/hosts.allow
/etc/hosts.deny
/etc/hosts
/etc/hosts.bak
/bin/hostname
/lib/modules/2.4.7-10/kernel/drivers/net/wan/hostess_sv11.o
[root@F_server etc]# [/B][/QUOTE]


这个结果都出来了你居然说不对???
晕~
高手都帮不了你了~
我就更不能了。      
iceblood,你好像没有注意研究我们讨论的问题。      
呵呵,我想superasp的意思不是这样吧?他可能是想忽略“host*”这个文件,
不过第一个问题可不可以这样解决:
find/ -name "abc" /var -prune -o -print
我也不是高手,所以建议仅供参考!      
都不对!