From owner-freebsd-questions@FreeBSD.ORG Wed Apr 7 09:35:39 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 B427016A4CE for ; Wed, 7 Apr 2004 09:35:39 -0700 (PDT) Received: from smtp.infracaninophile.co.uk (happy-idiot-talk.infracaninophile.co.uk [81.2.69.218]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4AF1B43D2D for ; Wed, 7 Apr 2004 09:35:38 -0700 (PDT) (envelope-from m.seaman@infracaninophile.co.uk) Received: from happy-idiot-talk.infracaninophile.co.uk (localhost.infracaninophile.co.uk [IPv6:::1])i37GZ2c0063881 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 7 Apr 2004 17:35:02 +0100 (BST) (envelope-from matthew@happy-idiot-talk.infracaninophile.co.uk) Received: (from matthew@localhost)id i37GZ1Kg063879; Wed, 7 Apr 2004 17:35:01 +0100 (BST) (envelope-from matthew) Date: Wed, 7 Apr 2004 17:35:01 +0100 From: Matthew Seaman To: Clint Gilders Message-ID: <20040407163501.GB63448@happy-idiot-talk.infracaninophile.co.uk> Mail-Followup-To: Matthew Seaman , Clint Gilders , freebsd-questions@freebsd.org References: <000801c41c77$35828a50$2e01a8c0@Craig> <20040407082128.GC3321@happy-idiot-talk.infracaninophile.co.uk> <4073FE6F.5030801@onlinehobbyist.com> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="p4qYPpj5QlsIQJ0K" Content-Disposition: inline In-Reply-To: <4073FE6F.5030801@onlinehobbyist.com> User-Agent: Mutt/1.5.6i 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 X-Virus-Scanned: clamd / ClamAV version devel-20040323, clamav-milter version 0.70a cc: freebsd-questions@freebsd.org Subject: Re: howto 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: Wed, 07 Apr 2004 16:35:39 -0000 --p4qYPpj5QlsIQJ0K Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Apr 07, 2004 at 09:13:19AM -0400, Clint Gilders wrote: > Matthew Seaman wrote: > >On Wed, Apr 07, 2004 at 04:06:18AM -0400, Jerry Hatok wrote: > >> I am trying to copy files from a cd I have into my usr directory. Th= e=20 > >> cd has one directory with a lot of subdirectories and files. Is ther= e=20 > >> a command that I can copy everything at once? If so what is it? If n= ot=20 > >> what would you suggest being the fastest way to copy everything? > >There's many, many ways of doing this sort of thing under Unix. > >Assuming that your CD Rom is mounted under /cdrom and you want to copy > >everything onto /home/jerry/cdimage then: > > > > % cd /cdrom > > % mkdir /home/jerry/cdimage > > % tar -cvf - . | ( cd /home/jerry/cdimage ; tar -xvpf - ) > > > >However there are any number of commands you could substitute for that > >3rd line: > > > > % find . -depth -print | cpio -pdmu /home/jerry/cdimage > > > >or, if you're installed the net/rsync port: > > > > % rsync -avx --delete /cdrom/ /home/jerry/cdimage/ >=20 > Are these not a little bit of overkill? Seems to me (in this case) it=20 > could be as simple as: >=20 > cp -Rp /cdrom/ /home/jerry/ Like I said: TIMTOWTDI. However, I tend not to think of cp(1) in the first instance because historically it tended to do nasty things, like turn sym-links into real files. Of course, the cp(1) in the system today is much better behaved than that, and your suggestion certainly does have merit. There is still this caveat in the cp(1) man page: Note that cp copies hard linked files as separate files. If you need to preserve hard links, consider using tar(1), cpio(1), or pax(1) instead. but that is unlikely to be anything that affects the OP -- I'm not even sure if the iso9660 filesystem on CD Roms even supports hard links. 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 --p4qYPpj5QlsIQJ0K Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.4 (FreeBSD) iD8DBQFAdC21dtESqEQa7a0RApDzAJ49sUAwbfaAgmQsOo25noTaiUZQAwCfdFHe FnBUvrnCYm7imA7hheynuqc= =8jgZ -----END PGP SIGNATURE----- --p4qYPpj5QlsIQJ0K--