un-tarring a disk file

Jonathan I. Kamens jik at athena.mit.edu
Fri May 4 04:44:05 AEST 1990


In article <12772 at smoke.BRL.MIL>, gwyn at smoke.BRL.MIL (Doug Gwyn) writes:
|> The "f" option to "tar" allows you to specify an archive file name
|> in place of the default (that is normally a magtape device file name).
|> However, for a .Z file you should first "uncompress" it.

  Actually, if you have "compress" and "uncompress" at your site, you
probably have "zcat" as well.  At the very least, you should have some
way of uncompressing a file to the standard output, rather than
uncompressing it back into disk space.

  If you do, then it's better to do the uncompress and untar at the same
time, so you don't have the uncompressed tar archive taking up extra
space (that is, after all, why it's compressed :-).  When I get a
compressed tar archive, I usually use:

  zcat filename.tar.Z | tar xvf -

The "-" for the filename tells tar to read from the standard input, as
per the tar man page.

Jonathan Kamens			              USnail:
MIT Project Athena				11 Ashford Terrace
jik at Athena.MIT.EDU				Allston, MA  02134
Office: 617-253-8495			      Home: 617-782-0710



More information about the Comp.unix.questions mailing list