Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 17 Mar 2000 10:23:54 +1300
From:      Jonathan Chen <jonc@logisticsoftware.co.nz>
To:        David_Gadoury@ccnotes.ccity.com
Cc:        freebsd-questions@FreeBSD.ORG
Subject:   Re: tar question
Message-ID:  <20000317102353.A37209@jonc.logisticsoftware.co.nz>
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
References:  <852568A4.006C7023.00@danube.ccity.com>

next in thread | previous in thread | raw e-mail | index | archive | help
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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20000317102353.A37209>