When downloading files, you will find that they are normally of the form filename.tar.Z or filename.tar.gz These files have been archived then compressed or zipped.
Files ending in .Z have been compressed using the compress command. Compressed files can be restored to their original form using the uncompress command.
Type:
uncompress filename.tar.Z
This replaces filename.tar.Z with filename.tar
Files ending in .gz have been compressed using the gzip command. Zipped files can be restored to their original form using the gunzip command.
Type:
gunzip filename.tar.gz
This replaces filename.tar.gz with filename.tar
The tar command is used for packing several files or even a whole directory into a single tarfile.
To unpack a tar file, type:
tar xvf filename.tar
Note: Always move to an empty directory before unpacking a tarfile.
When you unpack a tarfile its contents are written to the current directory. Any file or directory with the same name as the contents of the tarfile will be overwritten!
Alternatively, you can unpack a compressed/zipped tarfile using the zcat or gzcat command. (gzcat is a local alias for the GNU zcat command). This leaves the compressed .Z or .gz tarfile intact.
For example:
zcat filename.tar.Z | tar xvf -
or
gzcat filename.tar.gz | tar xvf -
The zcat command recreates the uncompressed tarfile, which is then piped into the tar command to extract the files.
There are no comments on this document