[Novalug] rm question

Derek LaHousse dlahouss@mtu.edu
Thu Oct 10 12:02:43 EDT 2013


Will, care to explain your flags?  In particular, I think "print0" is
the flag, not "print 0"
What about the use of -exec "rm {}" \;

On Thu, Oct 10, 2013 at 11:58 AM, William Sutton <william@trilug.org> wrote:
> 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?
>>>
>>>
>>>
>>>
>
> _______________________________________________
> Novalug mailing list
> Novalug@calypso.tux.org
> http://calypso.tux.org/mailman/listinfo/novalug
>



More information about the Novalug mailing list