Unpack a .tar.gz archive

Posted Almost 13 years ago. Visible to the public.

You can unpack a .tar.gz file into the current directory like this:

tar -xzvf archive.tar.gz

The options used are

-x
: Extract

-z
: Unzip

-f
: Process a file input

-v
: Be verbose, i.e. print each extracted file

Side notes:

  • The dash is optional (tar xzvf ... works as well).
  • For .tar.bz2 archives, use j instead of z (tar xjvf ...`)
  • In order to create a *.tar.gz archive, use -c flag instead of -x flag.
  • The order of parameters matters.
Henning Koch
Last edit
About 5 years ago
Jakob Scholz
Keywords
file, extract, gzip, untar
License
Source code in this card is licensed under the MIT License.
Posted by Henning Koch to makandra dev (2011-06-12 18:12)