9.1.1.3. Compressing and unpacking with gzip or bzip2
Data, including tarballs, can be compressed using zip tools. The
gzip command will add the suffix .gz to the
file name and remove the original file.
jimmy:~> ls -la | grep tar
-rw-rw-r-- 1 jimmy jimmy 61440 Jun 6 14:08 images-without-dir.tar
jimmy:~> gzip images-without-dir.tar
jimmy:~> ls -la images-without-dir.tar.gz
-rw-rw-r-- 1 jimmy jimmy 50562 Jun 6 14:08 images-without-dir.tar.gz
|
Uncompress gzipped files with the -d
option.
bzip2 works in a similar way, but uses an
improved compression algorithm, thus creating smaller files. See
the bzip2 info pages for more.
Linux software packages are often distributed in a gzipped
tarball. The sensible thing to do after unpacking that kind of
archives is find the README and read it.
It will generally contain guidelines to installing the package.
The GNU tar command is aware of gzipped
files. Use the command
tar zxvf file.tar.gz
for unzipping and untarring .tar.gz or
.tgz files. Use
tar jxvf file.tar.bz2
for unpacking tar archives that were
compressed with bzip2.