From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: "Maglinger, Paul" Newsgroups: gmane.os.tru64.managers Subject: SUMMARY: Maximum number of files that can be copied or moved Date: Mon, 21 Oct 2002 09:28:55 -0500 Sender: tru64-unix-managers-owner@ornl.gov Message-ID: <64E3EF472A96B048B9147D40BB0031A80347C02D@indyexchange.scvl.com> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: main.gmane.org 1035210514 26261 80.91.224.249 (21 Oct 2002 14:28:34 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Mon, 21 Oct 2002 14:28:34 +0000 (UTC) Return-path: Original-Received: from sws1.ctd.ornl.gov ([160.91.20.101]) by main.gmane.org with smtp (Exim 3.35 #1 (Debian)) id 183dXj-0006p7-00 for ; Mon, 21 Oct 2002 16:28:31 +0200 Original-Received: (qmail 13424 invoked by uid 5); 21 Oct 2002 14:29:19 -0000 Original-Followup-To: poster Precedence: bulk Original-Received: (qmail 13415 invoked by uid 49493); 21 Oct 2002 14:29:19 -0000 Original-Received: from PMAGLINGER@scvl.com by sws1 by uid 49491 with qmail-scanner-1.14 (clamscan: 0.51. spamassassin: 2.50-cvs. Clear:SA:0(-5.4/5.0):. Processed in 0.456269 secs); 21 Oct 2002 14:29:19 -0000 Original-Received: from unknown (HELO emroute1.cind.ornl.gov) (160.91.4.119) by 0 with SMTP; 21 Oct 2002 14:29:18 -0000 Original-Received: from emroute1.cind.ornl.gov (localhost [127.0.0.1]) by emroute1.cind.ornl.gov (PMDF V6.1-1 #39060) with ESMTP id <0H4C00HMN5KR4L@emroute1.cind.ornl.gov> for tru64-unix-managers@sws1.ctd.ornl.gov (ORCPT tru64-unix-managers@ornl.gov) ; Mon, 21 Oct 2002 10:29:18 -0400 (EDT) Original-Received: from indyexchange.scvl.com (scvl.com [12.28.0.30]) by emroute1.cind.ornl.gov (PMDF V6.1-1 #39060) with ESMTP id <0H4C005KG5KO28@emroute1.cind.ornl.gov> for tru64-unix-managers@sws1.ctd.ornl.gov (ORCPT tru64-unix-managers@ornl.gov) ; Mon, 21 Oct 2002 10:29:13 -0400 (EDT) Original-Received: by indyexchange.scvl.com with Internet Mail Service (5.5.2653.19) id ; Mon, 21 Oct 2002 09:29:00 -0500 Content-return: allowed Original-To: 'Tru64 Unix Managers list' X-Mailer: Internet Mail Service (5.5.2653.19) Xref: main.gmane.org gmane.os.tru64.managers:2137 X-Report-Spam: http://spam.gmane.org/gmane.os.tru64.managers:2137 > Can anyone tell if there is a maximum number of files that can be copied or > moved using wildcards in Tru64 Unix 5.1a at one time? > > My thanks to Dr. Blinn, Mike Smith, Mandell Degerness, Jim Belonis, Cory Erickson, Tim Cutts, Martin Adolfsson, and Joerg Bruehe for their responses. Some of the responses are as follows: >From Dr. Blinn: The practical upper limit is based on the number of characters of arguments you can pass from the shell (which is what parse the command, including expanding wildcards) and the command you are invoking. That number is a UNIX standard, and as I recall it's something like 2048 bytes. Obviously, with longer names you can pass fewer of them. From a practical perspective, you can use "xargs" to break up a list of names and pass them to the appropriate command, along with the appropriate target, or you can use a utility such as "tar" or "pax" that can accept a source file list, which works quite well for copies (and less well for moves, since you typically have to remove the files yourself, although as I recall "pax" has a move mode as well as a copy mode). >From Dr. Cutts: In most UNIX variants, this is a property partly of the shell, and partly of the operating system. Usually there is a maximum command length, defined by the operating system. I don't know how big this is for Tru64. Then there's also likely to be a maximum command line length in the shell you're using, which may or may not be smaller than the Tru64 limit. Typically system shells (sh, csh) have smaller limits than more recent shells you might use (such as bash). Usually, there are other, better ways of copying large numbers of files which get around the limit. Try some of these: tar cf - directory | ( cd target_dir && tar xf - ) or rsync -a directory target_dir or use find, although that's usually a bit less efficient than the above methods, and may not preserve ownerships and permissions. For many commands, xargs can usually be used to automatically build commands that fit in the command line length, and execute them. For example: cat /etc/passwd | cut -d: -f1 | xargs -l1 finger will run finger for every user in your passwd file, even if you've got thousands of them. I don't recommend you do this for real. :-) >From Cory Erickson: You are limited to ~38k of command line. This is hard set in sys/limits.h (ARG_MAX). Thanks everybody!