Quick Guide to Tar and Gzip

(Note: this is retyped from an old handout that Dr. Kent gave to some of his students once upon a time. I'm presenting it here because it was a lot easier to read than the man pages for tar, compress, gzip, uncompress, or gunzip.)

Disk Space Shortage - Please Help
  1. Delete
    _core_file
    executables and .o files for which you have the source code
    old mail

  2. Compress files using _gzip_ or _compress_
    gzip bigfile.c biggerfile.c
    creates compressed versions with .gz extension bigfile.c.gz

    gunzip bigfile.c.gz will uncompress the file later

  3. Use tar to archive directories and then compress.
    tar cvf jdir.tar jdir
    (where jdir is that name of a directory)

    gzip jdir.tar
    (creates jdir.tar.gz)

    /bin/rm -r jdir
    (deletes directory)

    To recreate later:
    gunzip jdir.tar.gz
    (uncompresses)

    tar xvf jdir.tar
    (untars and recreates directory)