Or this:
ls -1 "*March*" | xargs rm -f
hmmmm... that may not work either, but this DEFINITELY should
ls -1 "*March*" | awk '{printf(" -f %s\n",$1}' | xargs rm -f
(BTW, those are both the number 1 (one) not an l (el), telling it
print one file per line)
Bill Ward
Oh, and in answer to the question originally asked... the problem is how big
of a buffer the rm arguement can hold, which at one time was small (256
bytes), but I think is now about 4Kbytes.... a few pages. Therefore, if
all of your filenames would take less than that, it works. If it doesn't,
it won't, it'll fail with your error.... in reality, when you type
rm -f "foo*"
the command interpreter changes this to
rm -f foo1 foo2 foo3 foo4 foo5 foo6 foo7 foo8 foo9 foo10...
with all of the matches showing and then executes the statement. So now you
see where the couple K buffer comes in...
-----Original Message-----
From: David Talkington [mailto:[EMAIL PROTECTED]]
Sent: Saturday, April 29, 2000 11:56 PM
To: '[EMAIL PROTECTED]'
Cc: recipient.list.not.shown; @nswcphdn.navy.mil
Subject: Re: Arguments too long
Sorry, this is a workaround rather than a solution, and as such
doesn't answer your question, but what about:
ls -a > filelist
for i in `cat filelist`
do
rm -f $i
done
-d
--
David Talkington
Community Networking Initiative
[EMAIL PROTECTED]
244-1962
Jon Nichols wrote:
:'hatters,
:
:prolly an easy question.
:
:when i want to nuke a huge number of files in a given directory, i will
usually use globbing, something like, 'rm *March*'
:
:sometimes, in directories with hundreds of thousands of files
:i'll try a big glob rm and get an error like 'Arguments too long'.
:
:What determines how long that argument list can be, and could it be
temporarily changed for similar purposes?
:
:tia
:jon
--
To unsubscribe: mail [EMAIL PROTECTED] with "unsubscribe"
as the Subject.
--
To unsubscribe: mail [EMAIL PROTECTED] with "unsubscribe"
as the Subject.