[CentOS] find with exclude directory

Tue May 13 14:34:20 UTC 2014
Billy Crook <bcrook at riskanalytics.com>

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-Mieg at imag.fr> wrote:

> > On Mon, May 12, 2014 at 4:44 AM, Tim Dunphy <bluethundr at gmail.com>
> 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 at centos.org
> http://lists.centos.org/mailman/listinfo/centos
>



-- 
Billy Crook • Network and Security Administrator • RiskAnalytics, LLC