Originally posted by: LaurentOliva
The prune option works as follow :
You need to explicity specify the directory to exclude.
For example :
$ find . -name .ssh
./.ssh
./foo/bar/.ssh
$ find . \( -name foo -prune \) -o \( -name .ssh -print \)
./.ssh
You can also use wildcards :
$ find . \( -name fo* -prune \) -o \( -name .ssh -print \)
./.ssh
Filtering by directories in order not to exclude file searching :
$ find . \( -type d -name fo* -prune \) -o \( -name .ssh -print \)
./.ssh