Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 20 Nov 2001 14:12:40 -0600
From:      David Kelly <dkelly@hiwaay.net>
To:        David Kirchner <davidk@accretivetg.com>
Cc:        brain_damaged <brain_damaged@florida-wireless.com>, freebsd-questions@FreeBSD.ORG
Subject:   Re: untarring a chicken I mean a file
Message-ID:  <20011120141240.A53581@grumpy.dyndns.org>
In-Reply-To: <20011120115606.P9030-100000@localhost>; from davidk@accretivetg.com on Tue, Nov 20, 2001 at 11:56:25AM -0800
References:  <200111201456.AA1966932132@florida-wireless.com> <20011120115606.P9030-100000@localhost>

next in thread | previous in thread | raw e-mail | index | archive | help
On Tue, Nov 20, 2001 at 11:56:25AM -0800, David Kirchner wrote:
> On Tue, 20 Nov 2001, brain_damaged wrote:
> 
> > how do I untar something to a specific location or can't I .
> > Yes i read man tar but did not get it from that.
> 
> It's in there. :-) Check out '-C'

Or easier yet, cd to the place you want the stuff before launching tar.
Even if you have to spell out a long path to get back to the .tgz file.
Your home directory is always ~/ so its pretty easy to get to with
% tar -xvzf ~/tarfile.tgz

I always have a phobia as to whether or not the tar file was bundled in
a single directory or whether or not it was hundreds of little files
without a (sub)directory. So even if I expand it in my home directory
I'll create a throwaway directory to expand it into something like this:

% mkdir junk
% cd junk
% tar -xvzf ../tarfile.tgz

This way everything in junk/ came from the tar archive. Expanding into
an otherwise occupied directory can be hard to clean up afterwards if it
does something you don't like.

Come to think of it the FreeBSD ports collection does similar with a
"work/" directory.

-- 
David Kelly N4HHE, dkelly@hiwaay.net
=====================================================================
The human mind ordinarily operates at only ten percent of its
capacity -- the rest is overhead for the operating system.

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?20011120141240.A53581>