Re: [CentOS] find with exclude directory
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 > 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 {} \; > >> > > try something along the lines of: > > find / -regex '.*varnish.*' ! -regex '/usr/local/digitalplatform/.*' > > ___ > CentOS mailing list > CentOS@centos.org > http://lists.centos.org/mailman/listinfo/centos > -- Billy Crook • Network and Security Administrator • RiskAnalytics, LLC ___ CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos
Re: [CentOS] find with exclude directory
> 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*" -exec rm -rfv {} \; >> try something along the lines of: find / -regex '.*varnish.*' ! -regex '/usr/local/digitalplatform/.*' ___ CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos
Re: [CentOS] find with exclude directory
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 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, but the above statement > would delete everything including the varnish files in the digitalplatform > directory. > > > > > On Sun, May 11, 2014 at 12:39 PM, 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 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 this: > > > > > > [root@uszmpwsls014lb ~]# find / -path '/usr/local/digitalplatform/*' > > -prune > > > -o -name "*varnish*" | grep digitalplatform > > > /usr/local/digitalplatform/.bash_logout > > > /usr/local/digitalplatform/varnish-2.1.5.tar.gz > > > /usr/local/digitalplatform/.viminfo > > > /usr/local/digitalplatform/.ssh > > > /usr/local/digitalplatform/varnish-1360.tar.gz > > > /usr/local/digitalplatform/.emacs > > > /usr/local/digitalplatform/varnishncsa-init > > > /usr/local/digitalplatform/varnish-sysconfig-stg > > > /usr/local/digitalplatform/memcached-1.4.7.tar.gz > > > /usr/local/digitalplatform/.bash_profile > > > /usr/local/digitalplatform/.mozilla > > > /usr/local/digitalplatform/.subversion > > > /usr/local/digitalplatform/.bashrc > > > /usr/local/digitalplatform/.zshrc > > > /usr/local/digitalplatform/varnish-sysconfig > > > /usr/local/digitalplatform/default.vcl > > > /usr/local/digitalplatform/1360-apache-stage.tar.gz > > > /usr/local/digitalplatform/.bash_history > > > /usr/local/digitalplatform/memcached-1.4.7 > > > /usr/local/digitalplatform/httpd.conf > > > /usr/local/digitalplatform/varnish-2.1.5 > > > /usr/local/digitalplatform/varnish_reload_vcl > > > /usr/local/digitalplatform/varnish-prod.tar.gz > > > /usr/local/digitalplatform/varnish-init > > > /usr/local/digitalplatform/1360-stage-apache.tar.gz > > > > > > > > > I'd like to know what I'm doing wrong, and how I can best achieve the > > > desired results? > > > > > > Thanks > > > Tim > > > > > > > > > > > > -- > > > GPG me!! > > > > > > gpg --keyserver pool.sks-keyservers.net --recv-keys F186197B > > > ___ > > > CentOS mailing list > > > CentOS@centos.org > > > http://lists.centos.org/mailman/listinfo/centos > > > > > > > > -- > > - > > Hal Wigoda > > Chicago > > ___ > > CentOS mailing list > > CentOS@centos.org > > http://lists.centos.org/mailman/listinfo/centos > > > > > > -- > GPG me!! > > gpg --keyserver pool.sks-keyservers.net --recv-keys F186197B > ___ > CentOS mailing list > CentOS@centos.org > http://lists.centos.org/mailman/listinfo/centos > ___ CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos
Re: [CentOS] find with exclude directory
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.bin > it might work reasonably for this particular case, but you should note the limitations of such an approach. specifically this would exclude both /path/you/want/to/ignore/digitalplatform/varnish and /path/you/want/to/find/digitalplatform/varnish I'd also suggest using find / -name varnish, dropping the second grep and possibly using anchors with egrep to be very specific (e.g. | egrep -v "^/ignore/this/path|^/ignore/another/path" ___ CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos
Re: [CentOS] find with exclude directory
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 -o -name ... \) -print -- rgds Stephen ___ CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos
Re: [CentOS] find with exclude directory
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.0.0 /usr/lib64/libvarnishcompat.so.1.0.0 /usr/lib64/libvarnishcompat.so.1 /usr/lib64/libvarnishapi.so.1 /usr/lib64/libvarnish.so.1.0.0 /usr/share/doc/varnish-libs-2.0.6 /usr/share/doc/varnish-libs-2.0.6/LICENSE [root@uszmpwsls014lb ~]# find / -name "*varnish*" | sed '/digitalplatform$/d' | head -5 find: /proc/4604: No such file or directory /var/lib/varnish /var/lib/varnish/varnish_storage.bin /usr/lib64/libvarnish.so.1 /usr/lib64/libvarnishapi.so.1.0.0 /usr/lib64/libvarnishcompat.so.1.0.0 Brian, no that doesn't work. It returns nothing. [root@uszmpwsls014lb ~]# find / -path /usr/local/digitalplatform -prune -name \*varnish\* [root@uszmpwsls014lb ~]# But that's ok I think I'm all set with the above options. Thanks! Tim On Sun, May 11, 2014 at 12:50 PM, Hal Wigoda wrote: > 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 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, but the above statement > > would delete everything including the varnish files in the > digitalplatform > > directory. > > > > > > > > > > On Sun, May 11, 2014 at 12:39 PM, 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 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 this: > >> > > >> > [root@uszmpwsls014lb ~]# find / -path '/usr/local/digitalplatform/*' > >> -prune > >> > -o -name "*varnish*" | grep digitalplatform > >> > /usr/local/digitalplatform/.bash_logout > >> > /usr/local/digitalplatform/varnish-2.1.5.tar.gz > >> > /usr/local/digitalplatform/.viminfo > >> > /usr/local/digitalplatform/.ssh > >> > /usr/local/digitalplatform/varnish-1360.tar.gz > >> > /usr/local/digitalplatform/.emacs > >> > /usr/local/digitalplatform/varnishncsa-init > >> > /usr/local/digitalplatform/varnish-sysconfig-stg > >> > /usr/local/digitalplatform/memcached-1.4.7.tar.gz > >> > /usr/local/digitalplatform/.bash_profile > >> > /usr/local/digitalplatform/.mozilla > >> > /usr/local/digitalplatform/.subversion > >> > /usr/local/digitalplatform/.bashrc > >> > /usr/local/digitalplatform/.zshrc > >> > /usr/local/digitalplatform/varnish-sysconfig > >> > /usr/local/digitalplatform/default.vcl > >> > /usr/local/digitalplatform/1360-apache-stage.tar.gz > >> > /usr/local/digitalplatform/.bash_history > >> > /usr/local/digitalplatform/memcached-1.4.7 > >> > /usr/local/digitalplatform/httpd.conf > >> > /usr/local/digitalplatform/varnish-2.1.5 > >> > /usr/local/digitalplatform/varnish_reload_vcl > >> > /usr/local/digitalplatform/varnish-prod.tar.gz > >> > /usr/local/digitalplatform/varnish-init > >> > /usr/local/digitalplatform/1360-stage-apache.tar.gz > >> > > >> > > >> > I'd like to know what I'm doing wrong, and how I can best achieve the > >> > desired results? > >> > > >> > Thanks > >> > Tim > >> > > >> > > >> > > >> > -- > >> > GPG me!! > >> > > >> > gpg --keyserver pool.sks-keyservers.net --recv-keys F186197B > >> > ___ > >> > CentOS mailing list > >> > CentOS@centos.org > >> > http://lists.centos.org/mailman/listinfo/centos > >> > >> > >> > >> -- > >> - > >> Hal Wigoda > >> Chicago > >> ___ > >> CentOS mailing list > >> CentOS@centos.org > >> http://lists.centos.org/mailman/listinfo/centos > >> > > > > > > > > -- > > GPG me!! > > > > gpg --keyserver pool.sks-keyservers.net --recv-keys F186197B > > ___ > > CentOS mailing list > > CentOS@centos.org > > http://lists.centos.org/mailman/listinfo/centos > > > > -- > - > Hal Wigoda > Chicago > ___ > CentOS mailing list > CentOS@centos.org > http://lists.centos.org/mailman/listinfo/centos > -- GPG me!! gpg --keyserver pool.sks-keyservers.net --recv-keys F186197B ___ CentOS mailing list CentOS@centos.
Re: [CentOS] find with exclude directory
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't work? ___ CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos
Re: [CentOS] find with exclude directory
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 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, but the above statement > would delete everything including the varnish files in the digitalplatform > directory. > > > > > On Sun, May 11, 2014 at 12:39 PM, 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 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 this: >> > >> > [root@uszmpwsls014lb ~]# find / -path '/usr/local/digitalplatform/*' >> -prune >> > -o -name "*varnish*" | grep digitalplatform >> > /usr/local/digitalplatform/.bash_logout >> > /usr/local/digitalplatform/varnish-2.1.5.tar.gz >> > /usr/local/digitalplatform/.viminfo >> > /usr/local/digitalplatform/.ssh >> > /usr/local/digitalplatform/varnish-1360.tar.gz >> > /usr/local/digitalplatform/.emacs >> > /usr/local/digitalplatform/varnishncsa-init >> > /usr/local/digitalplatform/varnish-sysconfig-stg >> > /usr/local/digitalplatform/memcached-1.4.7.tar.gz >> > /usr/local/digitalplatform/.bash_profile >> > /usr/local/digitalplatform/.mozilla >> > /usr/local/digitalplatform/.subversion >> > /usr/local/digitalplatform/.bashrc >> > /usr/local/digitalplatform/.zshrc >> > /usr/local/digitalplatform/varnish-sysconfig >> > /usr/local/digitalplatform/default.vcl >> > /usr/local/digitalplatform/1360-apache-stage.tar.gz >> > /usr/local/digitalplatform/.bash_history >> > /usr/local/digitalplatform/memcached-1.4.7 >> > /usr/local/digitalplatform/httpd.conf >> > /usr/local/digitalplatform/varnish-2.1.5 >> > /usr/local/digitalplatform/varnish_reload_vcl >> > /usr/local/digitalplatform/varnish-prod.tar.gz >> > /usr/local/digitalplatform/varnish-init >> > /usr/local/digitalplatform/1360-stage-apache.tar.gz >> > >> > >> > I'd like to know what I'm doing wrong, and how I can best achieve the >> > desired results? >> > >> > Thanks >> > Tim >> > >> > >> > >> > -- >> > GPG me!! >> > >> > gpg --keyserver pool.sks-keyservers.net --recv-keys F186197B >> > ___ >> > CentOS mailing list >> > CentOS@centos.org >> > http://lists.centos.org/mailman/listinfo/centos >> >> >> >> -- >> - >> Hal Wigoda >> Chicago >> ___ >> CentOS mailing list >> CentOS@centos.org >> http://lists.centos.org/mailman/listinfo/centos >> > > > > -- > GPG me!! > > gpg --keyserver pool.sks-keyservers.net --recv-keys F186197B > ___ > CentOS mailing list > CentOS@centos.org > http://lists.centos.org/mailman/listinfo/centos -- - Hal Wigoda Chicago ___ CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos
Re: [CentOS] find with exclude directory
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, but the above statement would delete everything including the varnish files in the digitalplatform directory. On Sun, May 11, 2014 at 12:39 PM, 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 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 this: > > > > [root@uszmpwsls014lb ~]# find / -path '/usr/local/digitalplatform/*' > -prune > > -o -name "*varnish*" | grep digitalplatform > > /usr/local/digitalplatform/.bash_logout > > /usr/local/digitalplatform/varnish-2.1.5.tar.gz > > /usr/local/digitalplatform/.viminfo > > /usr/local/digitalplatform/.ssh > > /usr/local/digitalplatform/varnish-1360.tar.gz > > /usr/local/digitalplatform/.emacs > > /usr/local/digitalplatform/varnishncsa-init > > /usr/local/digitalplatform/varnish-sysconfig-stg > > /usr/local/digitalplatform/memcached-1.4.7.tar.gz > > /usr/local/digitalplatform/.bash_profile > > /usr/local/digitalplatform/.mozilla > > /usr/local/digitalplatform/.subversion > > /usr/local/digitalplatform/.bashrc > > /usr/local/digitalplatform/.zshrc > > /usr/local/digitalplatform/varnish-sysconfig > > /usr/local/digitalplatform/default.vcl > > /usr/local/digitalplatform/1360-apache-stage.tar.gz > > /usr/local/digitalplatform/.bash_history > > /usr/local/digitalplatform/memcached-1.4.7 > > /usr/local/digitalplatform/httpd.conf > > /usr/local/digitalplatform/varnish-2.1.5 > > /usr/local/digitalplatform/varnish_reload_vcl > > /usr/local/digitalplatform/varnish-prod.tar.gz > > /usr/local/digitalplatform/varnish-init > > /usr/local/digitalplatform/1360-stage-apache.tar.gz > > > > > > I'd like to know what I'm doing wrong, and how I can best achieve the > > desired results? > > > > Thanks > > Tim > > > > > > > > -- > > GPG me!! > > > > gpg --keyserver pool.sks-keyservers.net --recv-keys F186197B > > ___ > > CentOS mailing list > > CentOS@centos.org > > http://lists.centos.org/mailman/listinfo/centos > > > > -- > - > Hal Wigoda > Chicago > ___ > CentOS mailing list > CentOS@centos.org > http://lists.centos.org/mailman/listinfo/centos > -- GPG me!! gpg --keyserver pool.sks-keyservers.net --recv-keys F186197B ___ CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos
Re: [CentOS] find with exclude directory
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 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 this: >> >> [root@uszmpwsls014lb ~]# find / -path '/usr/local/digitalplatform/*' -prune >> -o -name "*varnish*" | grep digitalplatform >> /usr/local/digitalplatform/.bash_logout >> /usr/local/digitalplatform/varnish-2.1.5.tar.gz >> /usr/local/digitalplatform/.viminfo >> /usr/local/digitalplatform/.ssh >> /usr/local/digitalplatform/varnish-1360.tar.gz >> /usr/local/digitalplatform/.emacs >> /usr/local/digitalplatform/varnishncsa-init >> /usr/local/digitalplatform/varnish-sysconfig-stg >> /usr/local/digitalplatform/memcached-1.4.7.tar.gz >> /usr/local/digitalplatform/.bash_profile >> /usr/local/digitalplatform/.mozilla >> /usr/local/digitalplatform/.subversion >> /usr/local/digitalplatform/.bashrc >> /usr/local/digitalplatform/.zshrc >> /usr/local/digitalplatform/varnish-sysconfig >> /usr/local/digitalplatform/default.vcl >> /usr/local/digitalplatform/1360-apache-stage.tar.gz >> /usr/local/digitalplatform/.bash_history >> /usr/local/digitalplatform/memcached-1.4.7 >> /usr/local/digitalplatform/httpd.conf >> /usr/local/digitalplatform/varnish-2.1.5 >> /usr/local/digitalplatform/varnish_reload_vcl >> /usr/local/digitalplatform/varnish-prod.tar.gz >> /usr/local/digitalplatform/varnish-init >> /usr/local/digitalplatform/1360-stage-apache.tar.gz >> >> >> I'd like to know what I'm doing wrong, and how I can best achieve the >> desired results? >> >> Thanks >> Tim >> >> >> >> -- >> GPG me!! >> >> gpg --keyserver pool.sks-keyservers.net --recv-keys F186197B >> ___ >> CentOS mailing list >> CentOS@centos.org >> http://lists.centos.org/mailman/listinfo/centos > > > > -- > - > Hal Wigoda > Chicago -- - Hal Wigoda Chicago ___ CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos
Re: [CentOS] find with exclude directory
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. > > Here's what I was able to come up with: > > find / -path '/usr/local/digitalplatform/*' -prune -o -name "*varnish*" > > Which results in this: > > [root@uszmpwsls014lb ~]# find / -path '/usr/local/digitalplatform/*' -prune > -o -name "*varnish*" | grep digitalplatform > /usr/local/digitalplatform/.bash_logout > /usr/local/digitalplatform/varnish-2.1.5.tar.gz > /usr/local/digitalplatform/.viminfo > /usr/local/digitalplatform/.ssh > /usr/local/digitalplatform/varnish-1360.tar.gz > /usr/local/digitalplatform/.emacs > /usr/local/digitalplatform/varnishncsa-init > /usr/local/digitalplatform/varnish-sysconfig-stg > /usr/local/digitalplatform/memcached-1.4.7.tar.gz > /usr/local/digitalplatform/.bash_profile > /usr/local/digitalplatform/.mozilla > /usr/local/digitalplatform/.subversion > /usr/local/digitalplatform/.bashrc > /usr/local/digitalplatform/.zshrc > /usr/local/digitalplatform/varnish-sysconfig > /usr/local/digitalplatform/default.vcl > /usr/local/digitalplatform/1360-apache-stage.tar.gz > /usr/local/digitalplatform/.bash_history > /usr/local/digitalplatform/memcached-1.4.7 > /usr/local/digitalplatform/httpd.conf > /usr/local/digitalplatform/varnish-2.1.5 > /usr/local/digitalplatform/varnish_reload_vcl > /usr/local/digitalplatform/varnish-prod.tar.gz > /usr/local/digitalplatform/varnish-init > /usr/local/digitalplatform/1360-stage-apache.tar.gz > > > I'd like to know what I'm doing wrong, and how I can best achieve the > desired results? > > Thanks > Tim > > > > -- > GPG me!! > > gpg --keyserver pool.sks-keyservers.net --recv-keys F186197B > ___ > CentOS mailing list > CentOS@centos.org > http://lists.centos.org/mailman/listinfo/centos -- - Hal Wigoda Chicago ___ CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos
[CentOS] find with exclude directory
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 this: [root@uszmpwsls014lb ~]# find / -path '/usr/local/digitalplatform/*' -prune -o -name "*varnish*" | grep digitalplatform /usr/local/digitalplatform/.bash_logout /usr/local/digitalplatform/varnish-2.1.5.tar.gz /usr/local/digitalplatform/.viminfo /usr/local/digitalplatform/.ssh /usr/local/digitalplatform/varnish-1360.tar.gz /usr/local/digitalplatform/.emacs /usr/local/digitalplatform/varnishncsa-init /usr/local/digitalplatform/varnish-sysconfig-stg /usr/local/digitalplatform/memcached-1.4.7.tar.gz /usr/local/digitalplatform/.bash_profile /usr/local/digitalplatform/.mozilla /usr/local/digitalplatform/.subversion /usr/local/digitalplatform/.bashrc /usr/local/digitalplatform/.zshrc /usr/local/digitalplatform/varnish-sysconfig /usr/local/digitalplatform/default.vcl /usr/local/digitalplatform/1360-apache-stage.tar.gz /usr/local/digitalplatform/.bash_history /usr/local/digitalplatform/memcached-1.4.7 /usr/local/digitalplatform/httpd.conf /usr/local/digitalplatform/varnish-2.1.5 /usr/local/digitalplatform/varnish_reload_vcl /usr/local/digitalplatform/varnish-prod.tar.gz /usr/local/digitalplatform/varnish-init /usr/local/digitalplatform/1360-stage-apache.tar.gz I'd like to know what I'm doing wrong, and how I can best achieve the desired results? Thanks Tim -- GPG me!! gpg --keyserver pool.sks-keyservers.net --recv-keys F186197B ___ CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos