Beyond .zip: Secrets of the Archive Utility
If you’ve ever sent, or received, a big file via email, you’ve undoubtably encountered a zip file. Double-click one of these and it expands to show files hidden inside. A zip file, or archive, takes up less space than the original files, so that your documents, images and whatnot are easier to send or store. But what do you do if a file won’t expand or you come across a different type of archive? Here are answers to frequently asked questions about working with compressed files on Mac OS X.
Q: How does compression work?
A: File compression technology looks for repeated data and writes archives that eliminate these repetitions to save space. You’ll find some files shrink a lot—compressed text files can be half the size of the originals—and others not so much. If you try to compress a JPEG file, for instance, you won’t see much benefit, as the JPEG format already includes compression.
Q: How do I make a zip file on my Mac?
A: To compress a file, a folder, or a group of files in Mac OS X, select the item(s) in the Finder and then either choose File -> Compress Item Name, or right-click on the selected item(s) and choose Compress Item Name. If you compress a single file, the process will be very quick. If you compress a large folder containing several gigabytes of data, it could take several minutes.
Q: How do I open a zip file that I’ve received?
A: To uncompress a zip archive, double-click it. A system utility called Archive Utility leaps into action automatically. Archive Utility can work with many types of archives—others you might encounter include .bz, .gz and .tar. You can tell if it will work when the file is labeled with the standard zip icon.
Q: I’d like to have my archives expanded to a specific folder. Can I do this?
A: First, find Archive Utility: it’s located at /System/Library/Core Services/Archive Utility. Double-click its icon, and it appears in your Dock. A menu will display, but it won’t show any window. Choose Archive Utility -> Preferences.
Here you’ll see the option to choose where expanded files are placed. By default, these files expand into their current folder (or directory). To change the default destination click on the Save Expanded Files menu and choose Into. In the sheet that appears, select a new folder. For example, if you often download files and would like to expand archives into a folder other than your Downloads folder, you can create a separate folder for these archives.
Q: I’ve got old zip archives all over my hard drive. Is there a way to get rid of them automatically?
A: Choose Archive Utility -> Preferences and click on the After Expanding menu. From here you can choose Move Archive To Trash, Delete Archive, or Move Archive To. For this latter option, you then choose a folder. It’s worth noting that this last option does not copy the archive to the location you select, but actually moves it. So if you select a folder on a different disk, the archive will be placed in that folder, then deleted from its original location. This is a good idea if you need to keep copies of archives for some reason.
Q: Do I have to use the zip format?
A: The zip format will fit the bill for 99.9 percent of people trying to compress a file. But if you’re a Unix person, you might be happy to find two other options in the Archive Format menu. Compressed Archive, also known as a .cpgz archive, is a common Unix compression format. Regular Archive, also known as a .cpio archive, puts a group of files into an archive without compressing them.
Even if you choose another format in this menu, you will only be able to create a different type of archive from within Archive Utility. Open the utility and choose File -> Create Archive, or press Command-K. If you wish to regularly create .cpgz or .cpio archives, put Archive Utility in your Dock so you can launch it easily.
Q: How do I open archives that Archive Utility can’t handle?
A: There are some types of archives that Archive Utility simply can’t handle. One common format is .rar or Roshal ARchive. Also, sometimes, you might come across archives that expand from .zip to .cpgz, then back to .zip, in an endless loop.
In these cases, use Dag Ågren’s free The Unarchiver, a Swiss army knife for decompressing obscure archives. Not only will this program open many kinds of archives, but it can create in any of dozens of formats. You may never need most of these, but it’s good to know that if you get an archive in an obscure format, The Unarchiver can usually help.