next up previous contents
Next: Compressing files with bzip2 Up: Packing up and backing Previous: Archiving files with tar   Contents

Compressing files with gzip

The command gzip can be used to compress files in order to save space. For example:

gzip *.data

compresses all files with extension .data in the current directory. The gzip command is often combined with tar by using the z option to tar. So we can use:

tar czvf cs253.tar.gz cs253

to create a tarball that is also compressed. The convention is to name the compressed tarball with the extension .tar.gz. To unpack a compressed tarball, we would use the z option as well. For example:

tar xzvf cs253.tar.gz



Amit Jain 2013-04-22