This post has been superseded by an updated one I wrote in 2010:
Unix file compression basics

Original Post

Quick way to compress files using the command line in Mac OS X (and most *nix).

  1. Open Terminal, cd to the required directory
  2. For multiple files, use tar -cf [destination name].tar [source file(s)]
  3. Then Gzip the sucker! gzip [source file].
  4. Optionally, for maximum compatibility, use uuencoding on the Gzip file:
    uuencode [source file] [source file] > [destination name].uu. Yes, type the file name twice.

Also, for a quick way to zip hundreds of files individually, just cd to the directory, then just gzip *.

Footer Notes:

  • UNIX is awesome :D. And yes I know Mac OS X isn't UNIX, let me have my fun.
  • This is one of the reasons I can never go back to Windows.