File Compression

The routines zip, unzip, gzip, and gunzip are available to compress and decompress files; zip and gzip compress files, unzip and gunzip decompress files. The routine wiz contains a GUI and can be used with zip files. These files are in H:\CTC Tools, which is in the default path. All of these routines must be run from the command line.

zip and unzip
Using the zip routine will create a .zip file and compress one or more input files. The default is to create a file of type .zip. The following illustrates what must be typed at the command line:

      zip <nameof .zip file to create> <input files>
 
zip zzz run1.out run2.out run3.out will create a file <zzz.zip> containing the files <run1.out>, <run2.out>, and <run3.out>. The original files <run1.out>, <run2.out>, and <run3.out> remain intact.

Using the unzip routine will recreate the files contained in the .zip file in the directory in which the command is issued. The .zip file remains. If the file already exists, the default is to ask if you want to overwrite it.
 
Using the example above, unzip zzz.zip will recreate the files <run1.out>, <run2.out>, and <run3.out>. To overwrite files without prompting, use unzip -o zzz.zip.

Reference: zip -h, unzip -h

gzip and gunzip
The routine gzip processes one file at a time, creating a file with the .gz extension. The original file no longer exists.

      gzip infile creates the file <infile.gz>.

The routine gunzip recreates the original file. The .gz file is no longer there.
 
      gunzip infile.gz recreates <infile>.

Reference: gzip -h, gunzip -h

wiz: Graphical Interface
Type wiz at a command prompt to bring up the GUI to process zip files.
 
Comparison of zip and gzip
output file name 
zip: You must be explicitly name the output file.
gzip: The output file name is the input file name with the .gz extension added.

number of input files
zip: You can have any number of input files.
gzip: Only one input file is allowed.

status of input file
zip: The input files are unchanged.
gzip: The input file is overwritten with the .gz extension added.

Reasons for using zip with multiple input files
You preserve the input files unchanged.
By making only one .zip file, you save disk space for the zipped files.

If you encounter any problems or have any questions, please write to consult or call 607-254-8686 and press 2 to speak with a consultant.