From owner-freebsd-questions@FreeBSD.ORG Fri Jun 18 15:10:42 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 E522516A4CF for ; Fri, 18 Jun 2004 15:10:41 +0000 (GMT) Received: from smtp.infracaninophile.co.uk (happy-idiot-talk.infracaninophile.co.uk [81.2.69.218]) by mx1.FreeBSD.org (Postfix) with ESMTP id ED26C43D1D for ; Fri, 18 Jun 2004 15:10:40 +0000 (GMT) (envelope-from m.seaman@infracaninophile.co.uk) Received: from happy-idiot-talk.infracaninophile.co.uk (localhost [IPv6:::1]) i5IF9NEr091677 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 18 Jun 2004 16:09:23 +0100 (BST) (envelope-from matthew@happy-idiot-talk.infracaninophile.co.uk) Received: (from matthew@localhost)id i5IF9MoO091671; Fri, 18 Jun 2004 16:09:23 +0100 (BST) (envelope-from matthew) Date: Fri, 18 Jun 2004 16:09:22 +0100 From: Matthew Seaman To: Giorgos Keramidas Message-ID: <20040618150922.GB82217@happy-idiot-talk.infracaninophile.co.uk> Mail-Followup-To: Matthew Seaman , Giorgos Keramidas , Henrik W Lund , Yavuz Ma?lak , freebsd-questions@freebsd.org References: <1e3201c45522$c393f840$dc96eed5@maslak> <40D2D095.1080702@broadpark.no> <20040618145818.GA20561@orion.daedalusnetworks.priv> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="+pHx0qQiF2pBVqBT" Content-Disposition: inline In-Reply-To: <20040618145818.GA20561@orion.daedalusnetworks.priv> User-Agent: Mutt/1.5.6i X-Greylist: Message not sent from an IPv4 address, not delayed by milter-greylist-1.4 (smtp.infracaninophile.co.uk [0.0.0.0]); Fri, 18 Jun 2004 16:09:23 +0100 (BST) X-Virus-Scanned: clamd / ClamAV version devel-20040612, clamav-milter version 0.72a on smtp.infracaninophile.co.uk X-Virus-Status: Clean X-Spam-Status: No, hits=-4.8 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=2.63 X-Spam-Checker-Version: SpamAssassin 2.63 (2004-01-11) on happy-idiot-talk.infracaninophile.co.uk cc: Yavuz Ma?lak 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:10:42 -0000 --+pHx0qQiF2pBVqBT Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Jun 18, 2004 at 05:58:18PM +0300, Giorgos Keramidas wrote: > On 2004-06-18 13:23, Henrik W Lund wrote: > > Yavuz Ma?lak wrote: > > >Hello > > >I use freebsd4.9 > > >I have thousands of files in my any directory. and I need to copy them= to=20 > > >another directory. but when I started to copy them I got error as belo= w; > > >/bin/cp: Argument list too long. >=20 > > You could do it with a shell script: > >=20 > > [SOF] > > #!/bin/sh > >=20 > > for file in * > > do > > if [ -f "$file" ] > > then > > cp "$file" "$target_dir" #Define $target_dir yourself > > fi > > done > > [EOF] >=20 > Please note that this is very likely to fail at the expansion of > `for file in *' in very much the same way as `cp *' fails. >=20 > A better alternative is to start copying one level up or use xargs(1): >=20 > find . -maxdepth 1 | xargs -J '@' cp -Rp '@' /destination/path >=20 > or something similar. # find . -depth -print0 | cpio -p0dmu /destination/path Cheers, Matthew --=20 Dr Matthew J Seaman MA, D.Phil. 26 The Paddocks Savill Way PGP: http://www.infracaninophile.co.uk/pgpkey Marlow Tel: +44 1628 476614 Bucks., SL7 1TH UK --+pHx0qQiF2pBVqBT Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.4 (FreeBSD) iD8DBQFA0wWiiD657aJF7eIRAgVqAJ4sM82o+da1vVhoz9jQKHnBRVqkxQCgmY2o 67seKQ622tMCcntv1vN1JCA= =XMf9 -----END PGP SIGNATURE----- --+pHx0qQiF2pBVqBT--