From owner-freebsd-questions@FreeBSD.ORG Fri Jun 18 15:42:41 2004 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id AAA2E16A4CE for ; Fri, 18 Jun 2004 15:42:41 +0000 (GMT) Received: from clunix.cl.msu.edu (clunix.cl.msu.edu [35.9.2.10]) by mx1.FreeBSD.org (Postfix) with ESMTP id 9A68E43D53 for ; Fri, 18 Jun 2004 15:42:40 +0000 (GMT) (envelope-from jerrymc@clunix.cl.msu.edu) Received: (from jerrymc@localhost) by clunix.cl.msu.edu (8.11.7p1+Sun/8.11.7) id i5IFe4c26083; Fri, 18 Jun 2004 11:40:04 -0400 (EDT) From: Jerry McAllister Message-Id: <200406181540.i5IFe4c26083@clunix.cl.msu.edu> To: bmalik@ihlas.net.tr (=?iso-8859-9?Q?Yavuz_Ma=FElak?=) Date: Fri, 18 Jun 2004 11:40:01 -0400 (EDT) In-Reply-To: <1e3201c45522$c393f840$dc96eed5@maslak> from "=?iso-8859-9?Q?Yavuz_Ma=FElak?=" at Jun 18, 2004 01:55:26 PM X-Mailer: ELM [version 2.5 PL2] MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit cc: freebsd-questions@freebsd.org Subject: Re: copy or listing problem X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Jun 2004 15:42:41 -0000 > > Hello > I use freebsd4.9 > I have thousands of files in my any directory. and I need to copy them > to another directory. > but when I started to copy them I got error as below; > /bin/cp: Argument list too long. You didn't include the command you used, but I it was something like: cp * /otherdir/. That '*' on there makes the shell feed it all the file names on the command line. eg, the globbing function adds in all the file names before it is handed over to the cp command and since there are huge numbers of files, it makes the command line too long. > > Do I have to copy them in pieces ? You can try that. When I am too lazy or foggy to think up a find or script segment I often do something like: cp a* /otherdir/. cp b* /otherdir/. etc, But, it is possible for there to be too many files in some alphabet clumps even for that. A couple of other people have suggested pairing a find with the copy. That is the officially good way to go, but find can seem tricky to use at times. ////jerry > > What shall I do ? > > Thanks > _______________________________________________ > freebsd-questions@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-questions > To unsubscribe, send any mail to "freebsd-questions-unsubscribe@freebsd.org" > >