Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 22 Aug 2001 22:40:00 +0200
From:      Erik Trulsson <ertr1013@student.uu.se>
To:        Olivier Cortes <olive@deep-ocean.net>
Cc:        m p <sumirati@yahoo.de>, freebsd-questions@freebsd.org
Subject:   Re: How to untar a .tgz file
Message-ID:  <20010822224000.A56075@student.uu.se>
In-Reply-To: <20010822174234.A37914@APastourelles-102-1-2-26.abo.wa>
References:  <20010822150841.63108.qmail@web13302.mail.yahoo.com> <20010822174234.A37914@APastourelles-102-1-2-26.abo.wa>

next in thread | previous in thread | raw e-mail | index | archive | help
On Wed, Aug 22, 2001 at 05:42:34PM +0200, Olivier Cortes wrote:
> On Wed, Aug 22, 2001 at 05:08:41PM +0200, m p wrote:
> > It should be:
> > 
> > tar -xzvf /file/to/untar.tgz /path/to/extract/to
> 
> no, no.
> this way your are trying to find the file "/path/to/extract/to" in the
> archive and extract it in your current working dir.
> 
> with gnu tar (gtar), you can use option -C /path to do what you want.
> with bsd tar (the one aimed here), i don't know. i go in the good dir
> before extracting !

FreeBSD uses the GNU version of tar (albeit an older and somewhat
modified version) so the -C option works fine with FreeBSD too.
So to unpack the contents of a gziped tar file into a specific
directory the invocation could be:

  tar zxvf /file/to/unpack.tgz -C /destination/directory/

Or one could cd to the right directory and just do
  tar zxvf /path/to/file.tgz



-- 
<Insert your favourite quote here.>
Erik Trulsson
ertr1013@student.uu.se


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?20010822224000.A56075>