[K12OSN] OT: Scripting Question

Dan Young dyoung at mesd.k12.or.us
Thu Nov 30 16:46:18 UTC 2006


Nils Breunese wrote:
> Dan Young wrote:
> 
>>>> find /FOLDERNAME -type f -mtime +30 -exec rm -f {} ';'
>>>
>>> Fun trivia: xargs is faster than -exec'ing on every file. It will delete
>>> the files together with one invocation of "rm" (or in optimally sized
>>> chunks if you're deleting _lots_ of files):
>>>
>>> find /FOLDERNAME -type -f -mtime +30 -print0 | xargs -0 rm -f
>>
>> Oops:
>>
>> find /FOLDERNAME -type f -mtime +30 -print0 | xargs -0 rm -f
> 
> I don't see the difference. Is it me?

A misplaced hyphen:
'-type -f' vs. '-type f'

-- 
Dan Young <dyoung at mesd.k12.or.us>
Multnomah ESD - Technology Services
503-257-1562




More information about the K12OSN mailing list