Unpack a .tar.gz archive

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