How to Zip Files in Mac OS X
Ever wondered how to make a zip file in Mac OS X? We recently demonstrated how to password protect zip archives, but in the comments a reader asked a more simple yet completely valid question: “what about just making a standard zip file?”
Well, making a zip archive on a Mac is easy, and with the compression tools built directly into Mac OS X there is no need to download additional software or add-ons to quickly create zips and compress either a single file, a group of files, or an entire folder. If you’re unfamiliar with creating zips on the Mac, here is exactly how to do it, and quickly.
How to Make a Zip Archive in Mac OS X
You can use this to create zip files of files, folders, or both:
- Locate the items to zip in the Mac Finder (file system)
- Right-click on a file, folder, or files you want to zip
- Select “Compress Items”
- Find the newly created .zip archive in the same directory
If a single file is being zipped, the zip archive will maintain the standard file name but append the .zip extension.
If more than one file is being zipped, the archive will be named “Archive.zip”, and if multiple archives are created, they will be named successively “Archive 2.zip” and so on.
This works in all versions of Mac OS X, and you can access the compress item option from a right-click with a mouse, control-click with keyboard, or two-finger click on a trackpad from the Mac.
Extracting Zip Archives
Opening zip files is even easier, all you need to do is just double-click on the archive and it will expand automatically with Archive Utility in the same folder the archive is stored in.
For example, if you’re extracting an archive named “ZippedSample.zip” in the ~/Downloads/ directory, the resulting extracted folder would be named “ZippedSample” within that same ~/Downloads/ directory.
How to Create a Zip from the Command Line on Mac
Not interested in using the standard Finder and file system approach? Zip archives can also be created from the command line by using the terminal command ‘zip’ with the following syntax:
zip archive.zip file.txt
Another simple way to create an archive from the command line is to use the Terminal’s drag & drop support, type out ‘zip’ as usual but then drop in the file(s) to compress into the Terminal window.
Unzipping from the command line is also very simple, with the easy ‘unzip’ command:
You can specify paths and other details if interested, but if all you’re looking to do is extract a file there isn’t much more to do than the simple unzip command.
While it’s good to know the command line alternatives, most users are best served using the friendlier Mac Finder based approaches, either with zipping from the right-click method described above, or unzipping by just opening the file directly.