Department of Electrical Engineering and Computer Science



Compression and Archival

This document describes methods for compressing and archiving files/directories. Because EECS accounts have a disk quota, you may sometimes need to compress and archive files to save space.

For additional information about any of these commands, log onto an EECS machine and type man command.

gzip

gzip, short for GNU zip, is a software application used for compressing files, thereby saving disk space.

CommandEffect
gzip foo Encodes the file foo and replaces it with the compressed file foo.gz.
gzip -d foo.gz Decodes the gzip file foo.gz, replacing it with the decompressed file foo.

gzip is suitable for most applications. For more compression, bzip2 (discussed below) may be more suitable.

bzip2

CommandEffect
bzip2 foo Encodes file foo and replaces it with the compressed file foo.bz2.
bunzip2 foo.bz2 Decodes the bzip2 file foo.bz2 and replaces it with the decompressed file foo.

tar

tar, derived from tape archive, is a software application for archiving files and directories. tar is also capable of compressing files using gzip or bzip2.

CommandEffect
tar -cvfz foo.tgz dir-name Creates an archive with the contents of the dir-name directory, then compresses the archive into the file foo.tgz. (The options c, v, f, and z stand for “create”, “verbose” (list the files being archived on the console), “file name follows” (the archive name is the next argument), and “zip” respectively.)
tar -xvfz foo.tgz Decompresses the archive foo.tgz, then extracts the archived files and directories. (The options x, v, f, and z stand for “extract”, “verbose” (list the files being extracted to the console), “file name follows” (the archive name is the next argument), and “unzip” respectively.)

It is recommended that you “tar up” any files/directories that you will not be using for an extended period of time.

 


 

The University of Tennessee, Knoxville. Big Orange. Big Ideas.

Knoxville, Tennessee 37996 | 865-974-1000
The flagship campus of the University of Tennessee System