Messages in this thread | | | Date | Tue, 12 Nov 2002 18:23:59 -0500 (EST) | From | Bill Davidsen <> | Subject | Re: File Limit in Kernel? |
| |
On 12 Nov 2002, Adam Voigt wrote:
> I have a directory with 39,000 files in it, and I'm trying to use the cp > command to copy them into another directory, and neither the cp or the > mv command will work, they both same "argument list too long" when I > use: > > cp -f * /usr/local/www/images > > or > > mv -f * /usr/local/www/images > > Is this a kernel limitation? If yes, how can I get around it? > If no, anyone know a workaround? I appreciate it.
Sort of, there is a limit to how many k of arguments you can have on a command line. Having grown up with much smaller limits in early UNIX, I got into the habit of using xargs when I wasn't sure. You can avoid one exec per file behaviour by something like: ls | xargs -l50 echo | xargs -i mv "{}" destdir
You can also do useful things by using find and the -p option of cpio. -- bill davidsen <davidsen@tmr.com> CTO, TMR Associates, Inc Doing interesting things with little computers since 1979. [unhandled content-type:application/pgp-signature] | |