Expanding a gzipped tar files

One often obtains gzipped tar files, named like myfile.tgz or myfile.tar.gz. This document explains how to expand such files.

Suchs files generally contain multiple files/directories combined using the command tar and then compressed using the command gzip.

Let's consider a file named myfile.tgz

On athena (Solaris unix)

You need to call gzip and tar separately, but you can command them into a single command using "pipes".

  1. To test the integrity of the file and see its contents:
    gzip -dc myfile.tgz | tar tvf -
    
  2. To expand the file:
    gzip -dc myfile.tgz | tar xvf -
    

In linux

The linux version of tar can automatically call gzip, so you need only call tar and you don't need to use a pipe.

  1. To test the integrity of the file and see its contents:
    tar tzvf myfile.tgz
    
  2. To expand the file:
    tar xzvf myfile.tgz