Code:
tar -xzvf filename.tar.gz
x for extraction (rather than archiving), z for gzip comperssion, v for verbose output and f for "filename" (the filename must be right after letter 'f', separated by a space).
Code:
tar -xjvf filename.tar.bzip2
The same, but now the .tar file is compressed with bzip2 (and not gzip), so use option 'j' instead of 'z' to tell tar which uncompression to use.
More:
It would also work if you first uncompressed, then untarred:
First code (from above) would be like this:
Code:
gunzip filename.tar.gz
tar -xvf filename.tar
So 'gunzip' first un-gzips the compressed archive (a .tar file comes out) and then tar untars that .tar file (note that there's no 'x' in the options anymore, because there's no need to gunzip it anymore!)
The second codepiece (from the top) would also work as
Code:
bunzip2 filename.tar.bz2
tar -xvf filename.tar
And so on..got it?