Extract .tar.gz files from the CLI

Move to the directory containing the compressed file.

We'll use tar for this, which should be part of any base Linux system. Type the following command:

tar xvzf example.tar.gz

Tar will extract the file. To extract multiple files in the same directory, we'd use:

tar xvzf *.tar.gz

Posted by