Compress Files in Mac OS X Terminal, UNIX
This post has been superseded by an updated one I wrote in 2010:
Unix file compression basics
Quick way to compress files using the command line in Mac OS X (and most *nix).
- Open Terminal,
cdto the required directory
- For multiple files, use
tar -cf [destination name].tar [source file(s)]
- Then Gzip the sucker!
gzip [source file].
- 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
- 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.