[Novalug] rm question

William Sutton william@trilug.org
Thu Oct 10 11:58:04 EDT 2013


that might be too destructive

find . -type f -iname .ext1 -print 0 |xargs -0 rm

might be better

William Sutton

On Thu, 10 Oct 2013, William Sutton wrote:

> have you tried
>
> find . -type d -maxdepth 3 -print 0 |xargs -0 rm -rf
>
> or something similar?
>
> William Sutton
>
> On Thu, 10 Oct 2013, Roy Wilson wrote:
>
>> 
>>   Dumb question...
>> 
>>   I've tried every pattern of swapping switches, directories, etc and I
>> can't get rm to do what I want.
>> 
>>   I've got a 2tb drive with something on the order of 17,000 directories on
>> it.
>> 
>>   Most of those directories have several files with the same data in
>> different formats.
>> 
>>   I want to delete some of those formats.
>> 
>>   rm -r *.ext1 *.ext2 etc works - but only in the directory I'm physically
>> in - it doesn't recurse all the subdirectories.
>> 
>>   I KNOW this can be done.  Someone please tell me the (probably obvious)
>> correct command syntax is to get it to do what I want - please?
>> 
>> 
>> 
>> 
>


More information about the Novalug mailing list