From owner-freebsd-questions@FreeBSD.ORG Sun Jul 26 08:45:24 2009 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C055810656D8 for ; Sun, 26 Jul 2009 08:45:13 +0000 (UTC) (envelope-from mel.flynn+fbsd.questions@mailing.thruhere.net) Received: from mailhub.rachie.is-a-geek.net (rachie.is-a-geek.net [66.230.99.27]) by mx1.freebsd.org (Postfix) with ESMTP id A48EA8FC2E for ; Sun, 26 Jul 2009 08:45:13 +0000 (UTC) (envelope-from mel.flynn+fbsd.questions@mailing.thruhere.net) Received: from smoochies.rachie.is-a-geek.net (mailhub.rachie.is-a-geek.net [192.168.2.11]) by mailhub.rachie.is-a-geek.net (Postfix) with ESMTP id DE97B7E818 for ; Sun, 26 Jul 2009 00:45:12 -0800 (AKDT) From: Mel Flynn To: freebsd-questions@freebsd.org Date: Sun, 26 Jul 2009 00:45:11 -0800 User-Agent: KMail/1.11.4 (FreeBSD/8.0-BETA2; KDE/4.2.4; i386; ; ) References: <20090725222918.AC51DB7E0@kev.msw.wpafb.af.mil> <4A6C071A.3020800@infracaninophile.co.uk> In-Reply-To: <4A6C071A.3020800@infracaninophile.co.uk> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-6" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200907260045.12045.mel.flynn+fbsd.questions@mailing.thruhere.net> Subject: Re: limit to number of files seen by ls? X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Jul 2009 08:45:34 -0000 On Saturday 25 July 2009 23:34:50 Matthew Seaman wrote: > It's fairly rare to run into this as a practical > limitation during most day to day use, and there are various tricks like > using xargs(1) to extend the usable range. Even so, for really big > applications that need to process long lists of data, you'ld have to code > the whole thing to input the list via a file or pipe. ls itself is not glob(3) aware, but there are programs that are, like scp. So the fastest solution in those cases is to single quote the argument and let the program expand the glob. for loops are also a common work around: ls */* == for f in */*; do ls $f; done Point of it all being, that the cause of the OP's observed behavior is only indirectly related to the directory size. He will have the same problem if he divides the 4000 files over 4 directories and calls ls */*. -- Mel