There are many compression formats and you need different tools to compress/decompress them.
extension | compres command | decompress command
.Z |
The last format is actually compressed tar file. New version of tar can compress/decompress tar file directly but if your tar does not have a -z option, you can use two separate commands:
gzip -d file.tar.gzor use pipe
tar -xf file.tar
gzip -cd file.tar.gz | tar xf -