From owner-freebsd-questions Tue Oct 1 15:14:18 2002 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 F3FA537B401 for ; Tue, 1 Oct 2002 15:14:16 -0700 (PDT) Received: from sccrmhc01.attbi.com (sccrmhc01.attbi.com [204.127.202.61]) by mx1.FreeBSD.org (Postfix) with ESMTP id 57A7343E7B for ; Tue, 1 Oct 2002 15:14:16 -0700 (PDT) (envelope-from swear@attbi.com) Received: from localhost.localdomain ([12.242.158.67]) by sccrmhc01.attbi.com (InterMail vM.4.01.03.27 201-229-121-127-20010626) with ESMTP id <20021001221415.HFFG6431.sccrmhc01.attbi.com@localhost.localdomain>; Tue, 1 Oct 2002 22:14:15 +0000 Received: from localhost.localdomain (localhost [127.0.0.1]) by localhost.localdomain (8.12.5/8.12.5) with ESMTP id g91MHEMX006554; Tue, 1 Oct 2002 15:17:14 -0700 (PDT) (envelope-from swear@attbi.com) Received: (from jojo@localhost) by localhost.localdomain (8.12.5/8.12.5/Submit) id g91MGwTU006549; Tue, 1 Oct 2002 15:16:58 -0700 (PDT) (envelope-from swear@attbi.com) X-Authentication-Warning: localhost.localdomain: jojo set sender to swear@attbi.com using -f To: Erik Trulsson Cc: Dan Nelson , Beech Rintoul , freebsd-questions@FreeBSD.ORG Subject: Re: Copying directories contents References: <200210010955.35018.akbeech@anchoragerescue.org> <20021001175837.GF7147@dan.emsphone.com> <20021001180346.GA39309@falcon.midgard.homeip.net> From: swear@attbi.com (Gary W. Swearingen) Date: 01 Oct 2002 15:16:58 -0700 In-Reply-To: <20021001180346.GA39309@falcon.midgard.homeip.net> Message-ID: <791y79x0rp.y79@localhost.localdomain> Lines: 18 User-Agent: Gnus/5.0808 (Gnus v5.8.8) XEmacs/21.1 (Cuyahoga Valley) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Erik Trulsson writes: > > tar cf - user1 user2 user3 user4 | ( cd /destination ; tar xpf - ) > > To avoid starting an extra shell process you can also do: > > tar cf - user1 user2 user3 user4 | tar xpf - -C /destination Or, if you believe the manual which says -C is "probably untrustworthy" or want better portability, you could use to do the same: tar cf - user1 user2 user3 user4 | { cd /destination ; tar xpf - } > "cp -r" won't work well with symlinks. ("cp" will copy the file the > symlink points to, while tar will make a new symlink in the destination > directory.) But "cp -R" works well with symlinks. There might be other problems. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message