Re: [Nolug] find folder delete contents

From: Kevin Kreamer <kevin_at_kreamer.org>
Date: Tue, 13 Dec 2005 21:37:46 -0600
Message-ID: <439F938A.9040406@kreamer.org>

-ray wrote:
> On Tue, 13 Dec 2005, John Kosta wrote:
>
>> So:
>> find /path -type d -name "*[Cc]ache*" -print -exec "rm -f {}/*.*" \;
>>
>> doesn't work, because of M$'s
>> "Application Data/"
>
>
> Are you on linux? This works on debian. You may run into problems with
> other shell characters in filenames though (',",&,$,etc...).
>
> find . -type d -name '*[Cc]ache*' -exec rm -rf \"{}\" \;
>
> ray

How about (assuming GNU find and GNU xargs)
find . -path '*/[Cc]ache/*' -print0 | xargs -0 rm -Rf

HTH,
Kevin
___________________
Nolug mailing list
nolug@nolug.org
Received on 12/13/05

This archive was generated by hypermail 2.2.0 : 12/19/08 EST