The size is given as a number followed optionally by one of k (kB), m (MB), g (GB), or t (TB) (the default is m). Use zipsplit to split a zip file in to multiple smaller zipfiles. Use the -n switch to set the size of the splits. Click the Tools tab and click Multi-Part Zip File Type the name for your split Zip file and choose a target folder Note: The name must be different from the name of the open Zip file. Click OK to create the Split Zip file.
When you first purchased your Mac, one of the biggest deciding factors you considered is most probably disk space. But as years go by using your computer, its disk space seems to become smaller and smaller by the day, no matter how diligently you delete unneeded files and unused programs. In the computing world, one could never have too much storage space. There are some ways you could save space on your Mac, including manually deleting files and programs or automatically doing so with the help of apps designed to clean out junk such as Mac repair app. Another way — albeit less popular — to free up Mac space is to compress and zip files. In this article, we’ll show you how to zip a file on Mac, unzip it, and protect it with a password.
How to Zip a File on Mac
Converting any standard file to a compressed zip file the traditional way is effortless. You can do this to photos, videos, audio files, and documents, among others. Here are the steps:
- In Finder, look for the file or folder you want to compress and zip. Right-click or Ctrl-click on it.
- Select “Compress [name of file or folder].”
- Wait for the compression process to finish. Larger files may take time to end compressing.
- Once done, a new .zip file will appear in the same location as the original file or folder. You will also hear a system alert tone to notify you of the recently completed compression.
You can now send these compressed files or folders via email. You may also choose to delete the original files and folders if you want to save on disk space, but note that you can’t readily open or view the zipped versions. You’ll need to unzip them first (more on that later).
Pro Tip: Scan your Mac for performance issues, junk files, harmful apps, and security threats
that can cause system issues or slow performance.
Special offer. About Outbyte, uninstall instructions, EULA, Privacy Policy.
How to Zip Multiple Files on Mac
You can also compress multiple files and/or folders. Here’s how:
- First, you have to create a new folder in Finder or Desktop. Press Shift + Command (CMD) + N).
- Name the new folder.
- Drag the files you want to zip together to the folder you just created. IMPORTANT: Before dropping the files, hold down Alt to make sure that the files are copied to the new folder.
- Once all the files you want to zip together are in the folder, Ctrl+Click on the folder, then choose Compress.
- A new zip file should now be created.
- Drag the folder (not the zip file) you created earlier to the Trash.
How to Change the Save Location of Your Zip Files
By default, a zipped file or folder will be saved in the same place where the original is saved. But, you may also choose a dedicated destination for all of your compressed files. It is done by opening the compression app. In Mac, it’s called the Archive Utility. A simple Spotlight search can easily find it. After searching for the app on Spotlight, open it. Click the Archive Utility drop-down menu at the top of the screen, then click Preferences. Select the menu named Save archive, then select into. Next, choose your desired destination.
How to Open and Unzip a Zip File on Mac
Opening a zip file to view its contents is pretty straightforward. Just double-click on the file, and it will open. The zip file can still be seen in the location folder, but an unzipped copy will also be created in the same location. Meanwhile, if were sent a compressed file in a format other than zipping, such as .rar, you’ll need to use an app to decompress it, such as The Unarchiver. You can get this app for free from the App Store. Once installed, the app automatically works pretty much exactly like your Mac’s built-in zip tool. Just double-click the archive file, then the files and folders will be extracted and saved in the same location as the archive file.
How to Enable or Disable a Browser From Extracting Zipped ‘Safe’ Files Automatically
Some web browsers, such as Safari, automatically unzip downloaded compressed files that they consider to be safe by default. In Safari, these safe files include movies, pictures, sounds, PDFs, text documents, and archives. However, if you prefer to decompress downloaded zip files yourself, you can opt out of this feature.
In Safari, go to the drop-down menu. Locate and select Preferences, then click the General tab. Down below the window, you will see “Open “safe” files after downloading.” Leave the box checked if you want Safari to decompress these safe files automatically. Otherwise, untick the box.
How to Protect Your Zip Files With a Password
Now, here’s the more challenging bit. If you want to conceal some of your files, you can do so protecting it with a password. It is an excellent solution for highly confidential files since you probably won’t bother going through the quite complicated process to protect regular files. You may also do this for files that you are about to send through an unsecured messaging or mailing system. When you encrypt a zip file or folder, anyone who is trying to access the file using whether a Mac or PC will have to enter the password you create. To protect your zip file with a password, you’ll have to do it in the Terminal. As an example, let’s assume that the file is named softwaretested.jpg. Now, follow these steps:
- Open Terminal by going to Applications > Utilities > Terminal. You may also search for it on Spotlight.
- Type in cd Desktop then hit Enter/Return.
- Type in zip -e softwaretested.zip softwaretested.jpg, then hit Enter/Return.
- At this point, Terminal will ask you for the password. Type in the password you have in mind. Note that it will appear as if nothing is happening, but it’s designed this way so that the password will be concealed.
- When done typing the password, hit Enter/Return.
- The Terminal will ask you to verify the password. Type it again, then hit Enter/Return.
- Let Terminal finish the job. Status progress will be shown in the form of a percentage. When done, close the Terminal window.
A Note on Naming Your Zip Files
If you plan to protect a zip file or folder with a password, it is recommended that you don’t put spaces on the file name as much as possible. Telling the Terminal to password-protect a file with a name that has spaces will require you to do extra work. For instance, if your filename is software tested.jpg, you’ll have to type the code so as:
zip -e software tested.zip software tested.jpg
It’s not that difficult, but you should take extra caution whenever dealing with a file with spaces on its filename.
How to Password-Protect a Zip Folder
If it’s a zip folder you want to put a password on, change the -e extension to -er. For instance, zip -er softwaretested.zip softwaretested.
How to Open a Password-Protected Zip File or Folder
If you were sent a password-protected zip file or want to open your encrypted files, just double-click on them as usual, then enter the password when asked.
Zipping files on Mac is just one of the ways you can save space on your computer and compress big files and folders before sending them to someone else. Know of other file compression tips and methods? Share them with us in the comments below!
Click here to return to the 'Create split zip files from the command line' hint |
The -s parameter splits the archive into multiple zipped files fine, but how do I unzip them? Using unzip from the command only looks at the very last file in the archive, and when you specify the first file (.z01), it errors out with:
$ unzip bws.z01
Archive: bws.z01
End-of-central-directory signature not found. Either this file is not
a zipfile, or it constitutes one disk of a multi-part archive. In the
latter case the central directory and zipfile comment will be found on
the last disk(s) of this archive.
unzip: cannot find zipfile directory in one of bws.z01 or
bws.z01.zip, and cannot find bws.z01.ZIP, period.
The Unarchiver (free in MAS), unzips the split zip just fine, but hell if I can't find a way to get unzip at the command line to do the same thing.
Why not create the zip file and then use the split command to make your chunks? Those files can simply be concatenated and unzipped.
You and I could definitely do that, and that is certainly the way I would've gone if I wanted to split up a tgz file. My mom… not so much, especially not on Windows. If she were using a Mac I probably would've gone with a sparse bundle DMG file.
As I mentioned in the OP, the man page for zip explains the difference between that approach and using the split zip method.
Split zip is just one alternative to this problem, and it happens to have built in support on both Windows and OS X.
The rar command line tool can be downloaded as (never ending) trialware at rarlab.com. Unrar is free on all platforms. Usage: 'rar a -m0 -v4700000 archivename filename(s)' where a = add (create archive), -m0 = no compression (-m5 = max compression, not useful for video plus it takes much longer), -v with max size in KB (1000 bytes, append 'k' for size in 1024 bytes: -v4589843k).
Uh, what?
'It appears that OSX 10.8 removed the tar --tape-length flag'
Not really. Our fine friends at Apple have chosen to remind us there are other versions of software beside that provided by GNU. Mac OS X appears to have moved 'tar' to be 'bsdtar' and gnu tar is now 'gnutar'. Actually, it's a symlink. Do 'ls -l /usr/bin/tar' to see.
Try this:
gnutar --tape-length=102400 -cMv --file=tar_archive.{tar,tar-{2..100}} [files to tar]
Note, I would *NOT* change the link to gnutar. There be dragons.
Finder Question - How Can I See ALL Files Within A Folder (INCLUDING Subfolders??)
That is very helpful! I was a little taken aback when I found that normal 'tar' didn't have the --tape-length flag, even for historical purposes. Knowing about gnutar is very helpful, thanks for pointing it out!