.tar.Z files

Jonathan I. Kamens jik at athena.mit.edu
Tue Feb 12 07:42:41 AEST 1991


In article <1991Feb11.194436.2124 at cs.mcgill.ca>, troye at cs.mcgill.ca (Troy ENGLISH) writes:
|> I've used ftp to get some files which are *.tar.Z
|> What exactly do the .tar and .Z stand for and how
|> can i convert them to a format that I can use.

  First of all, I hope that when you transferred the files, you used ftp's
"binary" mode.  If you left ftp in the default mode it starts up in, it is
possible that the files are corrupted.

  Second, on to the suffixes.  The ".Z" suffix indicates a file that has been
compressed with the "compress" program (type "man compress" for more
information).  You can uncompress the file using "uncompress".  Or, you can
use "zcat" the file to uncompress it to the standard output, and pipe the
result to tar to do the file extraction.  But I'm getting ahead of myself.

  The ".tar" suffix implies that the file is a tar ("tar" originally stood
for "Tape ARchive", I believe) of a directory tree (type "man tar" for more
information).  After uncompressing the .tar.Z file, you can extract the files
from the tar by typing "tar xf filename.tar".  If you want more detailed
listings of what's being extracted, you can use "xvf" instead of just "xf". 
Finally, as I pointed out above, you can pipe the output of zcat directly into
tar in order to do the extraction; the advantage of this is that you never
actually have to save the uncompressed version of the file to disk, which
saves on I/O time to the disk and on disk space.  To do this, you would use
"zcat filename.tar.Z | tar xf -".  Note that the "-" tells tar to read from
the standard input.

  The ".Z" suffix is automatically added to a filename when it is compressed;
however, the ".tar" suffix isn't automatically added to any filename by tar or
anything like that; it's just a widely accepted convention for making it clear
that a file is in the tar format.

  The man pages for compress, uncompress, zcat and tar should provide you with
any additional information you need.

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



More information about the Comp.unix.questions mailing list