-original message-
Subject: Re: [gentoo-user] Any way around "Argument list too long"?
From: Alan Mackenzie <[email protected]>
Date: 2011-07-18 02:42
>Hi, Grant.
>
>On Sun, Jul 17, 2011 at 12:32:42PM -0700, Grant wrote:
>> My crontab deletes all files of a certain type in a certain folder
>> with yesterday's date in the filename. It usually executes but
>> sometimes fails with:
>
>> /bin/rm: Argument list too long
>
>> What would you do about this?
>
>Use xargs - in place of
> /bin/rm lots of files ......
>
>Use
> Lots_of_file_names | xargs rm
>
>. xargs then calls rm several times with batches of filenames each time.
>xargs is a standard Unix command.
You'll want to be extra careful with special characters like (space), single
quote, and double quote.
Better use find ..... -exec rm {} +
See: http://en.m.wikipedia.org/wiki/Xargs
Rgds,
--
FdS Pandu E Poluan
~ IT Optimizer ~
Sent from Nokia E72-1