Re: [CentOS] delete directories with find and exclude other directories

2016-02-04 Thread Denniston, Todd A CIV NAVSURFWARCENDIV Crane
From: Valeri Galtsev Sent: Wednesday, February 03, 2016 12:58 PM On Wed, February 3, 2016 11:37 am, Tim Dunphy wrote: > Hi all, > > I'm attempting to delete some directories and I want to be able to exclude > a directory called 'logs' from being deleted.

Re: [CentOS] delete directories with find and exclude other directories

2016-02-03 Thread Valeri Galtsev
On Wed, February 3, 2016 11:37 am, Tim Dunphy wrote: > 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 >

Re: [CentOS] delete directories with find and exclude other directories

2016-02-03 Thread m . roth
Tim Dunphy wrote: > 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 > ./d20160124-1120-df8mfb/deployments >

[CentOS] delete directories with find and exclude other directories

2016-02-03 Thread Tim Dunphy
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 ./d20160124-1120-df8mfb/deployments ./d20160124-1120-df8mfb/releases

Re: [CentOS] delete directories with find and exclude other directories

2016-02-03 Thread Gordon Messmer
On 02/03/2016 10:51 AM, m.r...@5-cent.us wrote: Right, but a) I think I tried using prune 20 years ago... and b) I thought the o/p wanted to not deal with any directory whose name was logs. leaving off prune would get everything, which is perhaps a bit more useful. I think you don't

Re: [CentOS] delete directories with find and exclude other directories

2016-02-03 Thread Chris Beattie
On 2/3/2016 12:37 PM, Tim Dunphy wrote: > I'm attempting to delete some directories and I want to be able to exclude > a directory called 'logs' from being deleted. Since you can't have a file and a directory named "logs" in the same directory at the same time (that I know of), you could turn on

Re: [CentOS] delete directories with find and exclude other directories

2016-02-03 Thread Gordon Messmer
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.

Re: [CentOS] delete directories with find and exclude other directories

2016-02-03 Thread Gordon Messmer
On 02/03/2016 10:11 AM, m.r...@5-cent.us wrote: find . -type d ! -name logs -prune That will prune all of the directories whose name is not "logs", starting with "." So... not terribly useful. ___ CentOS mailing list CentOS@centos.org

Re: [CentOS] delete directories with find and exclude other directories

2016-02-03 Thread m . roth
Gordon Messmer wrote: > On 02/03/2016 10:11 AM, m.r...@5-cent.us wrote: >> find . -type d ! -name logs -prune > > That will prune all of the directories whose name is not "logs", > starting with "." > > So... not terribly useful. Right, but a) I think I tried using prune 20 years ago... and b) I