Gentoo Archives: gentoo-user

From: Pandu Poluan <pandu@××××××.info>
To: gentoo-user@l.g.o
Subject: RE: [gentoo-user] Any way around "Argument list too long"?
Date: Sun, 17 Jul 2011 19:58:01
Message-Id: 3CvJ3DzDP2Vn.Bh2zCSVd@smtp.gmail.com
1 -original message-
2 Subject: Re: [gentoo-user] Any way around "Argument list too long"?
3 From: Alan Mackenzie <acm@×××.de>
4 Date: 2011-07-18 02:42
5
6 >Hi, Grant.
7 >
8 >On Sun, Jul 17, 2011 at 12:32:42PM -0700, Grant wrote:
9 >> My crontab deletes all files of a certain type in a certain folder
10 >> with yesterday's date in the filename. It usually executes but
11 >> sometimes fails with:
12 >
13 >> /bin/rm: Argument list too long
14 >
15 >> What would you do about this?
16 >
17 >Use xargs - in place of
18 > /bin/rm lots of files ......
19 >
20 >Use
21 > Lots_of_file_names | xargs rm
22 >
23 >. xargs then calls rm several times with batches of filenames each time.
24 >xargs is a standard Unix command.
25
26 You'll want to be extra careful with special characters like (space), single quote, and double quote.
27
28 Better use find ..... -exec rm {} +
29
30 See: http://en.m.wikipedia.org/wiki/Xargs
31
32
33 Rgds,
34 --
35 FdS Pandu E Poluan
36 ~ IT Optimizer ~
37
38 Sent from Nokia E72-1

Replies

Subject Author
Re: [gentoo-user] Any way around "Argument list too long"? Michael Mol <mikemol@×××××.com>