Click to See Complete Forum and Search --> : TAR help


sym
10-25-2001, 12:26 PM
Is there a way to tell tar to put the extracted contents in another directory?

Alos, I seem to remember there being a way of combining gunzip and tar into one command, does anyone know what it is?

Thanks

[ 25 October 2001: Message edited by: sym ]

7
10-25-2001, 12:35 PM
tar <file> <output dir>

Just like that. The gunzip option is z, as in
tar -zxvf <file> <dir>

sym
10-25-2001, 12:48 PM
It keeps looking for the directory in the archive and giving me an error:

"tar: <dir name>: not found in archive"

Any ideas

X_console
10-25-2001, 12:53 PM
The command should be:
tar -C /directory/to/unpack/ -xvzf package.tar.gz

7
10-25-2001, 12:57 PM
Oops. Read the man page wrong...

sym
10-25-2001, 01:05 PM
Thanks.

I was trying to put the -C after the other options. :o

bdg1983
10-25-2001, 04:46 PM
Originally posted by 7:
<STRONG>Oops. Read the man page wrong...</STRONG>

You didn't read the man page wrong. Sym just didn't bother. ;) :D