UNIX / Linux Decompress tgz / tar.gz Files
Q. I've downloaded a file from internet in .tgz format. How do I decompress .tgz file under UNIX or Linux operating system using a shell prompt?
A. This is archive file also known as tar ball. If an archive is compressed with an external tool, the compression program adds its own suffix as usual, resulting in filename endings like ".tar.Z", ".tar.gz", and ".tar.bz2" or tgz. To open such file type the following command at Linux shell prompt (GNU tar syntax):
$ tar -zxvf filename.tgz
$ tar -zxvf filename.tar.gz
$ tar -jxvf filename.tar.bz2
UNIX decompress tgz / tar.gz file
Type the following command:
$ gzip -dc filename.tgz | tar xf -
$ gzip -dc filename.tar.gz | tar xf -
If file extension ends with .Z, enter:
$ zcat filename.tar.Z | tar xf -
Capture each and every moment of life with a FREE 4 GB SD memory card with the purchase of select digital cameras from Canon, Nikon, Pentax and others from Amazon
E-mail
Print
Can't find an answer to your question? Contact us
Related Other Helpful FAQs:
Leave a Reply
We encourage your comments, and suggestions. But please stay on topic, be polite, and avoid spam. Thank you very much for stopping by our site!
Tags: command gzip, compress, compression program, gnu tar, gz file, gz files, gzip, Linux, shell, tar ball, tar bz2, tar xf, UNIX



Recent Comments
Today ~ 17 Comments
Today ~ 5 Comments
Today ~ 11 Comments
Yesterday ~ 24 Comments
Yesterday ~ 6 Comments