How To Create and Expand ZIP Files On a Mac

You can easily create a ZIP file on your Mac right in the Finder. You can also open and expand ZIP files in the Finder. To create password-protected encrypted ZIP files, you'll need to use a simple command in the Terminal app.
▶ You can also watch this video at YouTube.
▶ Watch more videos about related subjects: Finder (324 videos), Terminal (44 videos).

Video Summary

In This Tutorial

Learn how to create, manage, and extract ZIP files on your Mac using the Finder, Archive Utility, and Terminal. Includes tips for compression, organizing files, and creating encrypted ZIP archives.

ZIP a Single File Using the Finder (00:40)

  • Control-click, right-click, or two-finger click a file in Finder.
  • Choose Compress to create a ZIP file with the original name plus “.zip”.
  • Many file types like JPEG, video, and audio are already compressed, so the ZIP may not be smaller.

ZIP Multiple Files Into One Archive (01:39)

  • Select multiple files, control-click, and choose Compress.
  • Creates “Archive.zip” containing a folder with all selected files.
  • To name the archive, place files in a folder first and compress that folder.
  • Original files remain after compressing; delete them manually if desired.

Extract Files From a ZIP Archive (03:38)

  • Double-click a ZIP file to expand it in the same location.
  • Expanded files appear in a folder if multiple files were zipped together.
  • Original ZIP remains; delete it if no longer needed.

Using the Archive Utility To Create and Expand ZIP Files (04:44)

  • Open Archive Utility via Spotlight; use File > Create Archive or Expand Archive.
  • Only single files or folders can be zipped directly; combine files in a folder first.
  • Expanding via Archive Utility works like double-clicking in Finder.

Using Archive Utility To Change Finder ZIP Expanding Settings (05:48)

  • In Settings, adjust where expanded files are saved (same folder or a specific folder).
  • Choose what happens to the original ZIP: keep, trash, delete, or move.
  • Enable automatic expansion of nested ZIP files and selection of expanded items in the Finder.

Archive Utility Special Save Options (07:13)

  • Set a custom save location when creating archives with Archive Utility.
  • Change archive formats: standard ZIP, Apple archives (smaller but Mac-only), or Unix formats.
  • Optionally create Apple Encrypted Archives with a password for local security.

Advanced Methods and Encryption With ZIP In Terminal (08:35)

  • Use cd to navigate to the folder and zip to create archives.
  • Examples: zip archive file.txt or zip archive1 file1 file2.
  • Use wildcards like *.txt to zip multiple matching files.
  • Use -r to zip folders recursively with contents.
  • Add -e to encrypt with a password: zip -re archive files….

Opening an Encrypted ZIP File (10:01)

  • Double-click the encrypted ZIP file; you will be prompted for the password.
  • No Terminal is required for extracting encrypted archives.
  • Use man zip in Terminal to explore all advanced options.

Summary

You can easily zip and unzip files using Finder or Archive Utility, and customize behavior with Archive Utility settings. For advanced compression and password protection, use Terminal commands like zip -re. Encrypted ZIPs can always be opened by double-clicking and entering the password.

Video Transcript

Hi, this is Gary with MacMost.com. Let's look at how to create zip archives from files on your Mac and if somebody sends you a zip archive how to open it up and get to the files inside.
Now there are many reasons you may want to create a zip file archive of files on your Mac. You may want to take some larger files and compress them to save space. You also may want to bundle some files together in a zip archive to make it easier to send to somebody or post online. Another reason is you may just be cleaning up your files and decide you want to take a large number of files you don't need anymore and zip them all together into an archive as a single file. 
So creating a zip archive on your Mac is very easy to do. You can do it right in the Finder. Let's say I want to zip up this one file here. All I need to do is Control Click, right click, or two-finger click on a trackpad and that will bring up the Context Menu. Then you can go to Compress and select that. This will create a zip file from the original file. Notice I do save some space as the zip file is compressed so it is a bit smaller. 
Now it is important to realize that lots of file types are already compressed. For instance, JPEG images are already compressed. Video files and audio files are usually also using compression already. So, if you try to zip up one of those kinds of files you may not save any space at all. As a matter of fact the file may get bigger because it is already so well compressed with its own specialized algorithms that recompressing it as a zip actually makes a slightly larger file. 
Notice when I compress a single file it took the original file name with the extension and added dot zip to the end. That's pretty straight forward and if you were to unzip this file you would just get the original file back with the original name. But what happens if you select multiple files? I selected these three files and then I'm going to Control Click, right click, or two-finger click on them and select Compress. Doing that is going to give me a new file called Archive dot zip. Basically it has compressed those 3 files and put them in here. What it has actually done is it has created a Folder called Archive, put those 3 files into it, and zipped up that folder. So somebody unzipping this will actually get a Folder named Archive with those 3 files in it. 
Now if I would already create a folder, like by choosing File, New Folder here, I'll just name this My Archive. I can move these files in here and then when you select a folder and then compress that it will give you a zip file with the name of that folder in it. So in other words you can do the work ahead of time to get the folder name that you want instead of a folder just named Archive. Do note that if you select multiple folders it is like selecting multiple files. If you compress that you're going to get Archive dot zip, a folder that contains those two folders and perhaps other files as well if you included more.
If you find these videos valuable consider joining the more than 2000 others that support MacMost at Patreon. You get exclusive content, course discounts, and more. You can read about it at macmost.com/patreon. 
Another thing to note is that when you compress the files into a zip file it doesn't get rid of the original files. Notice when I do this the original three are still there. So if it is your intention to actually compress things to save some space or just to tidy things up then you're going to want to select the files that you compressed and delete them. But I'll show you an option to make that easier in a minute. 
Now when you go back to a zip file that you made or maybe somebody sends you a zip file getting the files out of it is relatively simple. If you don't think about it you may actually Control Click, right click, or two-finger click and look for a decompress or expand option and not see it here. Look for that through here as well and not know what to do. But, in fact, all you need to do is Open up the zip file and it will extract the files from inside it. You can do that by just double clicking. So all you need to do is double click the zip file. You can see it expands it, in this case giving you the archived folder here which was created because you zipped up three files so it created the archive folder for you. If you look inside you'll see the files in there. Notice it didn't get rid of the dot zip file. That's still there. So if you intention is to simply expand it and not need the zip file anymore you're going to want to delete that so you just have this one copy of all your files and not the duplicate that's the zip file now. It's up to you. There's a setting for that as well which I'll show you in a minute. 
Now when you're compressing files into a zip file in the Finder or if you're double-clicking on a zip file to open it up you may not realize it but you're using an app on your Mac. That's the app called Archive Utility. I'm going to use Spotlight and search for it. There it is. Archive Utility. You go to File and you can create archive or expand archive. If you use create archive you can select a single file and archive it and that will create a zip file. Just like zipping it up in the Finder. If you try to do it with multiple files you'll find you can't. If you hold the Command Key down you can't select a second file. The same if you hold Shift down you can't select a second file. You can select a Folder however and that will work. So, if you want to use Archive Utility for some reason, instead of the Finder,  to zip up files the key would be to put them into a folder first and then zip up that folder using the Archive Utility. 
Likewise you could go in Archive Utility to expand archive and then select a zip file and expand it. It does the same thing as double clicking on it in the Finder. 
So why would you ever want to use Archive Utility instead of just doing this in the Finder? Well you probably wouldn't except that Archive Utility has settings. So you can do some different things with it. More importantly, the settings in Archive Utility will affect how the Finder works. So in Archive Utility go to Settings and then there are two sections. The top section changes how it works in the Finder. Whereas the bottom section doesn't. The top section applies to expanding files. You can have the files expand into the same Directory as the Archive, which is the default and what we've seen. But we can also specify a special Folder for all zip files to expand into, if you like. In addition after expanding you can set it to leave the archive alone, which is what it does by default. The zip file stays there. But you can also have the zip file automatically move to the Trash or skip the trash and just Delete, or move to a specific folder, like a holding place you've got for zip files in case you need them later. 
You also have options for whether or not after expanding those items are selected in the Finder and if the zip file contains more zip files should it keep expanding all the zip files inside to decompress everything. The checkbox here will do that. All of this will not just change how Archive Utility works but also how it works in the Finder. However using Archive Utility to create the files uses these settings which do not change how the Finder works. You can change where the archives are saved to have them into a special folder but it only works in Archive Utility here. You can change the format. Instead of using the standard zip file format you can use Unix and Linux formats here or special Apple formats. The only reason you won't want to use these is maybe if you're a developer and you're working with special types of files that zip archive don't handle. Then you can go with these. But also Apple Archives are compressed better. So sometimes you'll end up with smaller files if you use an Apple Archive. It is just that these Apple Archives only work on a Mac. If you send them to somebody that is using Windows then they won't be able to open them up. 
In addition, the last option here actually will create an Apple Archive that is encrypted with a password. So you can very easily using just this Archive Utility and not having to go into the terminal create a password protected archive. If you're just creating something that you want to put on your Mac and you want to make sure it's extra secure with a password you can use Archive Utility, set it to Apple encrypted Archive and then create an archive from that file or folder and it will prompt you for the password. However, typically if you want to compress and encrypt a file or set of files you would want to do that into a zip file. You can't do that with Archive Utility or the Finder. But you can do it in Terminal. Even if you're not comfortable using the Terminal for other things it is very easy to use it for this. 
So I've launched Terminal App here and what I'm going to do now is first go into this folder with my files. So use CD, that will change directory, and then I don't need to type anything. I just need to go to this folder, move my pointer over the name here until I see the icon appear and then Drag & Drop that into the Terminal window. That will put the entire path here, even using backslashes in front of spaces properly. So I can now get to this folder. If I do LS to list the files I see I'm in this folder here. Now to zip something up you just use Zip and then just give it the name you want the zip archive to be. So we'll just call it archive. You can put dot zip after this or just leave that out and it will put it in for you. Then put the name of the file that you want to include. I'll just start typing Balances and I can use tab to autocomplete. Now I press Return and it is going to create this Archive dot zip. I have something just like if I were to have Control Clicked on this and compressed and then renamed the zip file afterwards.
But I can do some interesting things now that I'm in the Terminal. For instance, I can zip and give it a name, like Archive 1 here, and then I can list multiple files. So, balances and maybe alpha dot txt, and maybe this photo here. It's going to put all three of those into this. I can also use Wild Cards. So, I can do zip space and I can do asterisk dot txt and that will zip up all the files it finds that match that wild card there. In this case all the text files. Now if I want to do a Folder I would simply put the folder name. Now I can use backslashes for spaces. It's a little nicer, I think, to use double quotes. Then you can include spaces inside the double quotes, like that. That's going to zip up that folder into a zip file. Except it's only going to put the folder there. Not the files inside. I want to use the Option dash r. Dash r means recursive, which means if it's a folder look inside the folder and also zip up any files in there. So everything in the folder, as you would normally expect, and that's what dash r (-r)will get you. 
So typically you always use -r. Even if it's a single file it doesn't hurt to use it. Now I've shown you all that so I can also show you how to encrypt a zip file with a password. To do that you would just start with zip and you would do -r for recursive but also e for encrypted. Now you give it a name. So I'll do Archive 4. Then you list the files or put the folders here. So I'll just do, say, two files like that. Then Return and it's going to prompt me now for a password. I'll enter that password in and it will ask me to verify and now it creates this Archive here that I know is password protected. Now opening a zip file that is password protected doesn't require Terminal. All you need to do is double click on it and it will then prompt you for the password. So unzipping a file that is password protected and encrypted doesn't require Terminal. Only making it does. If you really want to do more using the Terminal here, note that you can type man for manual and then zip. Then you're going to get the full manual here that you can use a spacebar to page through or up and down arrows to go through and read about all the different options you have using zip in Terminal.
So if you need some more advanced options that's how you would get them. Hope you found this useful. Thanks for watching.

Comments: One Comment

    Sheldon
    1 second ago

    Thanks bunches

Leave a New Comment Related to "How To Create and Expand ZIP Files On a Mac"

:
:
:
0/500 (500 character limit -- please state your comment succinctly and do not try to get around this limit by posting two comments)