next up previous contents
Next: Putting them together Up: Archiving and Compressing Previous: Using tar

gzip and compress

    Unlike archiving programs for MS-DOS, tar does not automatically compress files as it archives them. Therefore, if you are archiving two 1-megabyte files, the resulting tar file will be two megabytes in size. The gzip command may be used to compress a file (the file to compress need not be a tar file). The command

will compress backup.tar and leave you with backup.tar.gz, the compressed version of the file. The -9 switch tells gzip to use the highest compression factor.

The gunzip command may be used to uncompress a gzipped file. Equivalently, you may use `` gzip -d''.

gzip is a relatively new tool in the UNIX community. For many years, the compress command was used instead. However, because of several factorsgif, compress is being phased out.

compressed files end in the extension .Z. For example, backup.tar.Z is the compressed version of backup.tar, while backup.tar.gz is the gzipped versiongif. The uncompress command is used to expand a compressed file; gunzip knows how to handle compressed files as well.



Ross Biro
Tue May 23 13:39:28 PDT 1995