The compress command is used to reduce the size of a file to approximately one-third its original size. This can be useful to reduce the size of .tar files (which can become extremely large) as well as any other large file that you aren't currently using but need to keep online. The format of the compress command is simple:
compress filename
This produces a file with the same name as the original, but with a .Z extension. Unlike the tar command, which archives without deleting the target directory, compress replaces the original file with the compressed version.
To restore a compressed file to its original uncompressed state:
uncompress filename
Some systems don't have a uncompress command, but instead use compress -d to uncompress a file.
Files ending in .gz are files that have been compressed using gzip, another compression program. To unzip these files, use the gunzip.
gunzip filename.gz
A file that ends in .tar.gz or .tgz is a compressed tar file. You need to unzip the file and then untar it.