LinuxInstruct: Tutorials: Creating Tarballs and Gzipping
By Brad Davis
Want to move a bunch of files? Want to make them smallers so that the transfer is faster? Here's how
To create a tarball use this syntax:
# tar -cf [name of tarball].tar [list of files or directories]
That will create the tarball. A tarball is just a bunch of files inside one. Now we want to compress it using gzip.
To compress it with maximum compression use this syntax:
# gzip -9 [file].tar
This will create a file called [file].tar.gz
The -9 is for maximum compression. It can be anything from 1-9
Using -9 compression I have compressed 500Mb of html docs into 130Mb. So the compression is pretty good. It took about 30min to compress, but that is pretty good compression.