Using Multiple -prune directives in a find command

Mike Clarke jmc-freebsd2 at
Mon Feb 7 23:21:32 UTC 2011

On Monday 07 February 2011, Martin McCormick wrote:

> 	Can one use the -prune directive multiple times in a
> find command to specify a list of directories not to descend?
> 	It would be like
> find . -name "*" -prune dir1 -prune dir2 -print
> or whatever you wanted find to do, but that does not work or I
> wouldn't be asking. Find appears to get confused and thinks dir1
> is a command.

find . -type d -name dir1 -prune -o -name dir2 -prune -o -name \* 

... should list all files except those in dir1 or dir2

Mike Clarke

More information about the freebsd-questions mailing list