Wednesday, May 22, 2024
HomeUNIXLinuxExtract a gzip compressed tar archive in Linux

Extract a gzip compressed tar archive in Linux

The version of tar in most Linux distributions supports gzip compression. This means that a gzipped tar file can be extracted in one simple command.


To extract the archive filename.tar.gz into the current directory:

tar xzf filename.tar.gz

If this fails, the version of tar may not support gzip compression. In this case, you can use the traditional two-stage command:

gzip -dc filename.tar.gz | tar xf -

Quinn McHenry
Quinn McHenry
Quinn was one of the original co-founders of Tech-Recipes. He is currently crafting iOS applications as a senior developer at Small Planet Digital in Brooklyn, New York.
RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Most Popular

LATEST REVIEWS

Recent Comments

error: Content is protected !!