From owner-freebsd-bugs@FreeBSD.ORG Thu Jun 2 04:59:37 2011 Return-Path: Delivered-To: freebsd-bugs@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4DE54106564A for ; Thu, 2 Jun 2011 04:59:37 +0000 (UTC) (envelope-from jhellenthal@gmail.com) Received: from mail-yi0-f54.google.com (mail-yi0-f54.google.com [209.85.218.54]) by mx1.freebsd.org (Postfix) with ESMTP id E8AC88FC15 for ; Thu, 2 Jun 2011 04:59:35 +0000 (UTC) Received: by yie12 with SMTP id 12so332478yie.13 for ; Wed, 01 Jun 2011 21:59:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:sender:date:from:to:cc:subject:message-id :reply-to:references:mime-version:content-type:content-disposition :in-reply-to:x-openpgp-key-id:x-openpgp-key-fingerprint :x-openpgp-key-url; bh=qtIbteursy1HxuNL49R08M+U7UDJcKunqiteeLe8Y1s=; b=sEmQHQaRnWy0ZUE/R0oHJVL+xh9KCLRImSxMGtkj3KWzp4DL2FGuvbka9kHZCAk8kR Ufok8SvVFEp1e8IjCE34CBaoYXQhVXFv0PUDgvcDdSIdUbZieJ1xfzsFdi2w+YsJB8h1 GONdyAw/Y9IqC53qXuILVl0yyUXaxRegUfRI0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=sender:date:from:to:cc:subject:message-id:reply-to:references :mime-version:content-type:content-disposition:in-reply-to :x-openpgp-key-id:x-openpgp-key-fingerprint:x-openpgp-key-url; b=nNgQ73sY0qTOrvTA81Bfyx4xN+P7Dso/UIcCIjUjS3aVCfQ7rIgjEAtJ1p12i4f0rK q28ZXITZHcgyspxQ7vzLOh9QBTufbcDOYV1zcRrhfooMOVsISV6Hg6imBln9pTt6/Hgy OlfALkBfngrgGnk9/T6Kz0uKswr6FvaFf2z84= Received: by 10.236.176.193 with SMTP id b41mr268876yhm.341.1306990775330; Wed, 01 Jun 2011 21:59:35 -0700 (PDT) Received: from DataIX.net (adsl-99-19-42-166.dsl.klmzmi.sbcglobal.net [99.19.42.166]) by mx.google.com with ESMTPS id w70sm198988yhl.59.2011.06.01.21.59.33 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 01 Jun 2011 21:59:33 -0700 (PDT) Sender: "J. Hellenthal" Received: from DataIX.net (localhost [127.0.0.1]) by DataIX.net (8.14.4/8.14.4) with ESMTP id p524xUq7011851 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 2 Jun 2011 00:59:30 -0400 (EDT) (envelope-from jhell@DataIX.net) Received: (from jhell@localhost) by DataIX.net (8.14.4/8.14.4/Submit) id p524xTHP011850; Thu, 2 Jun 2011 00:59:29 -0400 (EDT) (envelope-from jhell@DataIX.net) Date: Thu, 2 Jun 2011 00:59:29 -0400 From: Jason Hellenthal To: Eitan Adler Message-ID: <20110602045929.GB3103@DataIX.net> References: <201106011200.p51C0X0o012189@freefall.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="NDin8bjvE/0mNLFQ" Content-Disposition: inline In-Reply-To: <201106011200.p51C0X0o012189@freefall.freebsd.org> X-OpenPGP-Key-Id: 0x89D8547E X-OpenPGP-Key-Fingerprint: 85EF E26B 07BB 3777 76BE B12A 9057 8789 89D8 547E X-OpenPGP-Key-URL: http://bit.ly/0x89D8547E Cc: freebsd-bugs@freebsd.org Subject: Re: misc/157491: update ls/rm/mv/cp tools to be able to handle large amount of files X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: jhell@DataIX.net List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Jun 2011 04:59:37 -0000 --NDin8bjvE/0mNLFQ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Jun 01, 2011 at 12:00:33PM +0000, Eitan Adler wrote: > The following reply was made to PR misc/157491; it has been noted by GNAT= S. >=20 > From: Eitan Adler > To: bug-followup@freebsd.org, vermaden@interia.pl > Cc: =20 > Subject: Re: misc/157491: update ls/rm/mv/cp tools to be able to handle l= arge > amount of files > Date: Wed, 1 Jun 2011 11:59:36 +0000 >=20 > The limit is not in these tools. It is a constant number, defined in > bytes, in the kernel. This is designed to keep the amount of memory > required to store these command line options bounded. > You could see the value with > $getconf ARG_MAX > 262144 > =20 > I suggest you use find + xargs which automatically will figure out the > correct number of arguments and run the command for you. > =20 Even using your shell to do this will yield better results than trying to pass every file as an argument. Knowledge of how the shell works in this manner can be learned from the manual and through some scripting guides out there on the net "somewhere". While find is just as sufficient, here is another example that will use just the tools you mentioned. mkdir -p /usr/obj/tmp_m for file in /var/db/portsnap/files/*; do cp -v $file /usr/obj/tmp_m done This is probably one of the most commonly used shell scripting examples. Large things can be done here. Good Luck. --=20 "Unity can only be manifested by the Binary. Unity itself and the idea of U= nity are already two." -- Buddha Regards, (jhell) Jason Hellenthal --NDin8bjvE/0mNLFQ Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.17 (FreeBSD) Comment: http://bit.ly/0x89D8547E iQEcBAEBAgAGBQJN5xiwAAoJEJBXh4mJ2FR+gAkIAKBw5gJxfekj5XBhL+pll21c entucnMPlR3dEqemMWbnOyRFK659lzi05kN2hBddn1YYUfBUwcnaiXnmmO+i1QIG 224ynFMigtNMWQqRwLNXz7V7cLVQs5bG3DnF3Ym7bBOZqMZuzma3fMHm+awuu2A4 JF9oiqMxaBOBRKhewr02S4nSDf+lbC4hHiP5wLs+8uTZhCogibd4DA7inrS+K+gK uBZeCjXpk6NnZpNoU2R3fEe39mFmJkQYrr5X7qlojprpVs7zJEEXpIEV++KCjff0 RB6l23hEDtydZeSfu45nnaP5mC+ka8FPl55mqSyYMJI+D/ChKRYbbmZFtB6/1Xo= =AEUf -----END PGP SIGNATURE----- --NDin8bjvE/0mNLFQ--