From owner-freebsd-hackers Fri Jan 4 19:53:58 2002 Delivered-To: freebsd-hackers@freebsd.org Received: from scaup.prod.itd.earthlink.net (scaup.mail.pas.earthlink.net [207.217.120.49]) by hub.freebsd.org (Postfix) with ESMTP id 6525C37B405 for ; Fri, 4 Jan 2002 19:53:55 -0800 (PST) Received: from pool0341.cvx40-bradley.dialup.earthlink.net ([216.244.43.86] helo=mindspring.com) by scaup.prod.itd.earthlink.net with esmtp (Exim 3.33 #1) id 16Mhu5-0003vH-00; Fri, 04 Jan 2002 19:53:53 -0800 Message-ID: <3C3678D0.49B77037@mindspring.com> Date: Fri, 04 Jan 2002 19:53:52 -0800 From: Terry Lambert X-Mailer: Mozilla 4.7 [en]C-CCK-MCD {Sony} (Win98; U) X-Accept-Language: en MIME-Version: 1.0 To: Brooks Davis Cc: David Miller , freebsd-hackers@FreeBSD.ORG Subject: Re: Overriding ARG_MAX References: <20020104190303.A21307@Odin.AC.HMC.Edu> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Brooks Davis wrote: > > I have a system where I need/want to handle lots of files in a single > > directory. Lots as in 100-200K files. ls | wc -l breaks because the > > value of ARG_MAX in sys/syslimits.h is too small. If I change it from > > 65536 to 4meg and rebuild the world it works fine. > > ls | xargs wc -l > > would work with an arbitrary number of files. No, it wouldn't. First off, you would be line counting the file contents, not the number of files. Second, the "ls" command alone will *never* hit ARG_MAX, and neither will "wc -l", if it's pipe'd to to count the number of files. He's obviously using a globbing expression he's not telling us about, and the message is from the shell expasion of the expression. Thirdly, even if it was the number of lines in the files he wanted to count, the totals will be off if xargs were to invoke "wc -l" multiple times, so the command as written can't work anyway. -- Terry To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message