Arg list too long

Arg list too long

Post by Rustem Nagumano » Wed, 05 May 1999 04:00:00



I have a dir with over 2000 files
When I try ls * (tar,cp,mv... etc.) in this dir
AIX answer: Arg list too long

Is there are some solution ???

 
 
 

Arg list too long

Post by Tony R. Benne » Thu, 06 May 1999 04:00:00




Quote:>I have a dir with over 2000 files
>When I try ls * (tar,cp,mv... etc.) in this dir
>AIX answer: Arg list too long

>Is there are some solution ???

check out xargs...
--



 
 
 

Arg list too long

Post by Dave Aronson (remove x's to rep » Thu, 06 May 1999 04:00:00


 > I have a dir with over 2000 files
 > When I try ls * (tar,cp,mv... etc.) in this dir
 > AIX answer: Arg list too long
 >
 > Is there are some solution ???

Aside from what others have said, don't overlook the obvious: put some
of the files in other dirs, possibly subdirs.

--
Dave Aronson, Sysop, AirNSun (f120.n109.z1.fidonet.org) +1-703-319-0714
Opinions MINE, not by GeoCities/Template/Mensa/NRA/SCA/CAUCE/USGov/God!
Support Rep. Smith's no-spam bill, NOT Sen. Murkowski's spam-is-OK one!
See my web site, http://listen.to/davearonson (last update 1999-05-03).

 
 
 

Arg list too long

Post by Dave Marquard » Thu, 06 May 1999 04:00:00



> I have a dir with over 2000 files
> When I try ls * (tar,cp,mv... etc.) in this dir
> AIX answer: Arg list too long

> Is there are some solution ???

Sure.  Break up the list in pieces.  Maybe use something like

         find . -prune -print | xargs -I '{}' cp '{}' somedir

-Dave

 
 
 

Arg list too long

Post by Lawry Sim » Thu, 06 May 1999 04:00:00


Quote:>I have a dir with over 2000 files
>When I try ls * (tar,cp,mv... etc.) in this dir
>AIX answer: Arg list too long

>Is there are some solution ???

The only solution I have found so far is to actually use the cpio command to
copy files from one directory to another.

e.g.  In the directory with 2000+ files, to copy to another directory, use
the following...

find . | cpio -pduv /path/directory

Regards,
Lawry

 
 
 

Arg list too long

Post by Dick Wieling » Fri, 07 May 1999 04:00:00


Quote:>check out xargs...

Yep, I agree on that. It depends on what you want to do with the files. If
for instance you want to remove all files in your directory:

ls | xargs -n 100 rm

For every 100 arguments rm is called.

Copying your files can also be done with tar:

tar cvf - . | (cd targetdir; tar xvf -)

 
 
 

Arg list too long

Post by Michael Pans » Wed, 12 May 1999 04:00:00



> I have a dir with over 2000 files
> When I try ls * (tar,cp,mv... etc.) in this dir
> AIX answer: Arg list too long

> Is there are some solution ???

look at the command xargs

--
B.Braun Melsungen AG
Michael Panse Abt. GI/G         Tel.: 05661 713797
Schwarzenberger Weg             Fax:  05661 713699
D 34212 Melsungen

 
 
 

Arg list too long

Post by Ronald S Woa » Fri, 14 May 1999 04:00:00


The alternative is to pipe ls outpur through [e]grep or some other pattern matcher (awk/perl). The problem is that commandline expansion exceeds shell commandline limits...

--
Ronald S Woan



    I have a dir with over 2000 files
    When I try ls * (tar,cp,mv... etc.) in this dir
    AIX answer: Arg list too long
    Is there are some solution ???

  look at the command xargs
--
B.Braun Melsungen AG
Michael Panse Abt. GI/G         Tel.: 05661 713797  
Schwarzenberger Weg             Fax:  05661 713699
D 34212 Melsungen

 
 
 

1. sco-list: arg list too long

man xargs

Bill
--

UUCP:               camco!bill  PO Box 820; 2835 82nd Avenue S.E. S-100
FAX:            (206) 232-9186  Mercer Island, WA 98040-0820; (206) 236-1676
URL: http://www.celestial.com/

A child can go only so far in life without potty training.  It is not
mere coincidence that six of the last seven presidents were potty
trained, not to mention nearly half of the nation's state legislators.
                -- Dave Barry

2. compaq 1600, Mouse, and Redhat

3. arg list too long: help?

4. AD1816

5. /bin/ls: arg list too long

6. New or Revised TAs on websco, 960123

7. Arg list too long

8. Stuck with SiS and X!

9. grep: cannot execute [Arg list too long] ???

10. ODT - ksh: /bin/ls: arg list too long

11. arg list too long

12. err: arg list too long

13. arg list too long