Gentoo Archives: gentoo-user

From: Alan Mackenzie <acm@×××.de>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] Any way around "Argument list too long"?
Date: Sun, 17 Jul 2011 19:45:56
Message-Id: 20110717194230.GC3232@acm.acm
In Reply to: [gentoo-user] Any way around "Argument list too long"? by Grant
1 Hi, Grant.
2
3 On Sun, Jul 17, 2011 at 12:32:42PM -0700, Grant wrote:
4 > My crontab deletes all files of a certain type in a certain folder
5 > with yesterday's date in the filename. It usually executes but
6 > sometimes fails with:
7
8 > /bin/rm: Argument list too long
9
10 > What would you do about this?
11
12 Use xargs - in place of
13 /bin/rm lots of files ......
14
15 Use
16 Lots_of_file_names | xargs rm
17
18 . xargs then calls rm several times with batches of filenames each time.
19 xargs is a standard Unix command.
20
21 > - Grant
22
23 --
24 Alan Mackenzie (Nuremberg, Germany).