How do I create a .tar.gz file?

This is one way to create a .tar.gz file:

tar -cvzf <output filename> <directory>

This means: * -c = create new archive * -v = be verbose * -z = compress using gzip * -f = filename to create for the new archive

For the directory don't do "directory/*" just do "directory" with no slash.

Filenames should end in ".tar.gz" as they are tarr'ed then zipped.

Last updated: 17/10/2012