On Tue, 2004-06-29 at 12:03, Terry Collins wrote:
> Peter Hardy wrote:
> 
> > cd /var/spool/mqueue; ls | xargs rm
> 
> Doesn't it barf on the ls with the same message?

You had me worried for a minute. :-)

[EMAIL PROTECTED]:~$ mkdir tmp
[EMAIL PROTECTED]:~$ cd tmp
[EMAIL PROTECTED]:~/tmp$ for filename in `seq 1 50000`; do touch $filename;
done
*go and have lunch*
[EMAIL PROTECTED]:~/tmp$ rm *
bash: /bin/rm: Argument list too long
[EMAIL PROTECTED]:~/tmp$ ls | xargs rm
[EMAIL PROTECTED]:~/tmp$ ls
[EMAIL PROTECTED]:~/tmp$

ls doesn't actually deal with any arguments, it's basically just dumping
the contents of the . inode to stdout. (note: claim may be wildly
inaccurate and simplistic)

And just to add to the obscure ls arguments thread, I just discovered
-1, to output one filename per line. I've never needed this, as GNU ls
seems to default to that when it's outputting to a pipe. But it's good
to know!

-- 
Pete

-- 
SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html

Reply via email to