From owner-freebsd-questions Thu Mar 16 13:24: 1 2000 Delivered-To: freebsd-questions@freebsd.org Received: from logisticsoftware.co.nz (logisticsoftware.co.nz [202.37.163.1]) by hub.freebsd.org (Postfix) with ESMTP id 71AB937BCFD for ; Thu, 16 Mar 2000 13:23:58 -0800 (PST) (envelope-from jonc@logisticsoftware.co.nz) Received: from jonc.logisticsoftware.co.nz (jonc.logisticsoftware.co.nz [10.3.1.1]) by logisticsoftware.co.nz (8.9.3/8.9.3) with ESMTP id KAA23108; Fri, 17 Mar 2000 10:23:55 +1300 (NZDT) Received: (from jonc@localhost) by jonc.logisticsoftware.co.nz (8.9.3/8.9.3) id KAA37241; Fri, 17 Mar 2000 10:23:54 +1300 (NZDT) (envelope-from jonc) Date: Fri, 17 Mar 2000 10:23:54 +1300 From: Jonathan Chen To: David_Gadoury@ccnotes.ccity.com Cc: freebsd-questions@FreeBSD.ORG Subject: Re: tar question Message-ID: <20000317102353.A37209@jonc.logisticsoftware.co.nz> References: <852568A4.006C7023.00@danube.ccity.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 1.0i In-Reply-To: <852568A4.006C7023.00@danube.ccity.com>; from David_Gadoury@ccnotes.ccity.com on Thu, Mar 16, 2000 at 02:52:43PM -0500 Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Thu, Mar 16, 2000 at 02:52:43PM -0500, David_Gadoury@ccnotes.ccity.com wrote: > > > what exactly does the following command do. (how does it work) > > tar cf - . | (cd /usr/var; tar xf - ) It's copying the current directory downwards onto /usr/var. "tar cf - ." will instruct tar to output the archive onto std output. "(cd /usr/var; tar xf -)" will run in a sub-shell, which will first change to /usr/var and then extract an archive from stdin. The "(..)" is essential so that the extraction-process ends up in the right place without affecting the archiving-process. Cheers. -- Jonathan Chen Once is dumb luck. Twice is coincidence. Three times and Somebody Is Trying To Tell You Something. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message