Re: delete directories with find and exclude other directories

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]



On 02/03/2016 09:37 AM, Tim Dunphy wrote:
If I try to exlclude the logs directory with the prune command I get back
no results.

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

What am I doing wrong?

You're not applying the prune command to items named logs, for one. :)

find . -name logs -prune -o -type d -print

find will crawl the directory. Items named logs will not be examined further. Otherwise, if the item is a directory, its name will be printed.
_______________________________________________
CentOS mailing list
CentOS@xxxxxxxxxx
https://lists.centos.org/mailman/listinfo/centos



[Index of Archives]     [CentOS]     [CentOS Announce]     [CentOS Development]     [CentOS ARM Devel]     [CentOS Docs]     [CentOS Virtualization]     [Carrier Grade Linux]     [Linux Media]     [Asterisk]     [DCCP]     [Netdev]     [Xorg]     [Linux USB]
  Powered by Linux