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 ???
Is there are some solution ???
check out xargs...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 ???
> 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).
> Is there are some solution ???
find . -prune -print | xargs -I '{}' cp '{}' somedir
-Dave
The only solution I have found so far is to actually use the cpio command toQuote:>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 ???
e.g. In the directory with 2000+ files, to copy to another directory, use
the following...
find . | cpio -pduv /path/directory
Regards,
Lawry
Yep, I agree on that. It depends on what you want to do with the files. IfQuote:>check out xargs...
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 -)
> Is there are some solution ???
--
B.Braun Melsungen AG
Michael Panse Abt. GI/G Tel.: 05661 713797
Schwarzenberger Weg Fax: 05661 713699
D 34212 Melsungen
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
4. AD1816
6. New or Revised TAs on websco, 960123
9. grep: cannot execute [Arg list too long] ???
10. ODT - ksh: /bin/ls: arg list too long