I'm trying to exclude the directory /zones in my find command. I don't have GNU find available, just the native Solaris find.I tried something like this:find / -type d ! -name zonesThe problem is that with this exclude I also lose sub-directories like /etc/zones.Is there a way to specify the complete directory name like:find / -type d ! -name ^\/zonesI already tested lots of approaches but I can't include the / in front of the string.
Exclude directory in (native Solaris) find command
find;solaris
Here is a portable way:find / -type d -exec test {} = /zones \; -prune -o -type d -printNote that GNU find might be available on an alternate directory depending on the Solaris release you are using (like /usr/sfw/bin/gfind, /usr/gnu/bin/find, ...).