[CentOS] delete directories with find and exclude other directories

Wed Feb 3 17:37:44 UTC 2016
Tim Dunphy <bluethundr at gmail.com>

Hi all,

I'm attempting to delete some directories and I want to be able to exclude
a directory called 'logs' from being deleted.

This is my basic find operation (without the exclusion)

# find . -type d  |tail -10

I'm just tailing the output so that you have an idea of what's going on
without taking up the whole page. :)

If I try to exlclude the logs directory with the prune command I get back
no results.

root at ops-manager:/tmp/tmp# find . -type d  -prune -o -name 'logs' -print
root at ops-manager:/tmp#

What am I doing wrong?


GPG me!!

gpg --keyserver pool.sks-keyservers.net --recv-keys F186197B