Compressing and archiving files

Because files often contain large amounts of redundant data and empty space, you can reduce their size significantly with tools such as compress, gzip and bzip2. The latter two are more widely used than compress. Bzip2 provides the greatest compression, but it is also the slowest. Gzip offers a good balance of compression rate and speed. More details are available on their man pages.

Note that compress, gzip and bzip2 are able to compress only individual files. To both package and compress a group of files, create an archive file using tar as described here:

The tar archiver command provides a simple way to package groups of files into a single large file for transport, storage, and retrieval. Details are available on the tar man page.


Create an archive file with tar:

tar -cvf archive_name.tar file1 file2 file3

Extract files from the archive file:

tar -xvf archive_name.tar

Create a bzip2-compressed archive file:

tar cjf archive_name.tar.bz2 file1 file2 file3

Extract files from the archive:

tar xf archive_name.tar.bz2

Create a gzip-compressed archive file:

tar czf archive_name.tgz file1 file2 file3

Extract files from the gzipped archive:

tar xf archive_name.tgz

The "j" and "z" options are not necessary for extracting a file in Linux because they are used automatically when the archive has been compressed with gzip or bzip2. (If they are included in a script you use, there is no harm in leaving them there.)



To use meld first unload grads and zlib modules.


Editing files

Among the most widely used text editors are Vim, Vi and Emacs.

Several excellent tutorials are available for text editors, including the following:

vi Tutorial -
GNU Emacs Manual -
The Emacs Tutorial - Free Software Foundation
A Tutorial Introduction to GNU Emacs - University of Chicago Library


Making executables

A compiler toolchain creates executables. For a variety of reasons, people call the compilers directly only for very simple programs.

More complex programs sometimes require a more complex building chain, usually based on Autoconf, to make software packages automatically adaptable to many UNIX/Linux systems.

Generating the executable usually is a two-step process using the GNU Build System:

GNU make (gmake) is the GNU incarnation of POSIX make, and as such it is more user friendly and full-featured. It usually is used as a tool for managing compilation and builds of software packages (but it can do more). It functions consistently across platforms.

See the GNU Make Manual.