Re: [CentOS] find with exclude directory

2014-05-13 Thread Billy Crook
don't forget to escape that exclamation point if typing on bash. On Tue, May 13, 2014 at 1:50 AM, Nicolas Thierry-Mieg < nicolas.thierry-m...@imag.fr> wrote: > > On Mon, May 12, 2014 at 4:44 AM, Tim Dunphy > wrote: > > > >> Thanks. But what if I want to turn that statement into one that will >

Re: [CentOS] find with exclude directory

2014-05-12 Thread Nicolas Thierry-Mieg
> On Mon, May 12, 2014 at 4:44 AM, Tim Dunphy wrote: > >> Thanks. But what if I want to turn that statement into one that will delete >> everything it finds? I need to preserve the contents of that directory. >> >> As in : find / -path '/usr/local/digitalplatform/*' -prune -o -name >> "*varnish*"

Re: [CentOS] find with exclude directory

2014-05-12 Thread Cliff Pratt
Why not copy the directory elsewhere, then delete the rest and move it back? You'd take a copy of it anyway, if it is important, right? Cheers, Cliff On Mon, May 12, 2014 at 4:44 AM, Tim Dunphy wrote: > Thanks. But what if I want to turn that statement into one that will delete > everything i

Re: [CentOS] find with exclude directory

2014-05-11 Thread zep
On 05/11/2014 01:06 PM, Tim Dunphy wrote: > Hal & Jack > > Both are perfect! Thanks > > [root@uszmpwsls014lb ~]# find / -print | grep -v digitalplatform | grep > varnish > /var/lib/varnish > /var/lib/varnish/uszmpwsls014lb > /var/lib/varnish/uszmpwsls014lb/_.vsl > /var/lib/varnish/varnish_storage

Re: [CentOS] find with exclude directory

2014-05-11 Thread Stephen Harris
On Sun, May 11, 2014 at 12:33:47PM -0400, Tim Dunphy wrote: > find / -path '/usr/local/digitalplatform/*' -prune -o -name "*varnish*" Try find / -path /usr/local/digitalplatform -prune -o name '*varnish*' -print Without the explicit -print, find will implicitly add one e.g find / \( -path ..

Re: [CentOS] find with exclude directory

2014-05-11 Thread Tim Dunphy
Hal & Jack Both are perfect! Thanks [root@uszmpwsls014lb ~]# find / -print | grep -v digitalplatform | grep varnish /var/lib/varnish /var/lib/varnish/uszmpwsls014lb /var/lib/varnish/uszmpwsls014lb/_.vsl /var/lib/varnish/varnish_storage.bin /usr/lib64/libvarnish.so.1 /usr/lib64/libvarnishapi.so.1

Re: [CentOS] find with exclude directory

2014-05-11 Thread Brian Miller
On Sun, 2014-05-11 at 12:33 -0400, Tim Dunphy wrote: > Hey all, > > I'm trying to do a find of all files with the phrase 'varnish' in the > name, but want to exclude a user home directory called > /usr/local/digitalplatform. find / -path /usr/local/digitalplatform -prune -name \*varnish\* doesn'

Re: [CentOS] find with exclude directory

2014-05-11 Thread Hal Wigoda
find / -print | grep -v digitalplatform | grep varnish | xargs rm But test this first - you don't want to remove anything by accident. On Sun, May 11, 2014 at 11:44 AM, Tim Dunphy wrote: > Thanks. But what if I want to turn that statement into one that will delete > everything it finds? I need

Re: [CentOS] find with exclude directory

2014-05-11 Thread Tim Dunphy
Thanks. But what if I want to turn that statement into one that will delete everything it finds? I need to preserve the contents of that directory. As in : find / -path '/usr/local/digitalplatform/*' -prune -o -name "*varnish*" -exec rm -rfv {} \; I'm thinking the grep -v would be a visual thing,

Re: [CentOS] find with exclude directory

2014-05-11 Thread Hal Wigoda
So: find / -print | grep -v digitalplatform | grep varnish On Sun, May 11, 2014 at 11:39 AM, Hal Wigoda wrote: > Just grep it out. > > find . -print | grep -v digitalplatform > > -v excludes > > On Sun, May 11, 2014 at 11:33 AM, Tim Dunphy wrote: >> Hey all, >> >> I'm trying to do a find of

Re: [CentOS] find with exclude directory

2014-05-11 Thread Hal Wigoda
Just grep it out. find . -print | grep -v digitalplatform -v excludes On Sun, May 11, 2014 at 11:33 AM, Tim Dunphy wrote: > Hey all, > > I'm trying to do a find of all files with the phrase 'varnish' in the > name, but want to exclude a user home directory called > /usr/local/digitalplatform.

[CentOS] find with exclude directory

2014-05-11 Thread Tim Dunphy
Hey all, I'm trying to do a find of all files with the phrase 'varnish' in the name, but want to exclude a user home directory called /usr/local/digitalplatform. Here's what I was able to come up with: find / -path '/usr/local/digitalplatform/*' -prune -o -name "*varnish*" Which results in thi