Feature, maybe misfeature

Peter Nitschke email at ace.net.au
Thu Sep 19 00:08:09 IST 2002


>> As no-one seems to have posted anything, how about a line like this
which
>> will delete all files under the current directory more than 14 days old:
>>    find . -type f -mtime +14 -print | xargs rm -f
>
>I'd recommend using:
>    find . -type f -mtime +14 -print0 | xargs -0 rm -f
>
>That way you won't get into trouble if a file name contains spaces or
>some other strange character.  Find puts a null character at the end of
>each file name and xargs expects null-separated arguments.

However if you don't specify a directory to run it in, life will get pretty
exciting......

Peter



More information about the MailScanner mailing list