How To Create and Expand ZIP Files On a Mac

MacOS Tips
1 follower
#macOS #MacTips #MacOSTips #AppleTips #MacBook #MacBookTips #Productivity #Workflow #Shortcuts #KeyboardShortcuts #MacShortcuts
AI Generated·May contain errors
Video Summary
AI GeneratedThis video provides a comprehensive guide on creating and managing zip archives on a Mac. It covers basic Finder methods, the configuration of the Archive Utility app, and advanced techniques using the Terminal for password-protected encryption.
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's 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's already so well compressed with its own specialized algorithm that recompressing it
as a zip actually makes a slightly larger file. Now notice when I compressed a single file,
it took the original file name with the extension and added .zip to the end. That's pretty
straightforward 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've 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.zip. Basically it has compressed
those three files and put them in here. What it's actually done is it's created a folder called
archive, put those three files into it, and zipped up that folder. So somebody unzipping this will
actually get a folder named archive with those three files in it. Now if I were to already create
a folder, like by choosing file new folder here, I'll just name this my archive, I could move these
files in here and then when you select a folder and then compress that, it'll give you a zip file
with the name of that folder in it. So in other words, you could do the work ahead of time to get
the folder name that you want instead of a folder just named archive. And do note that if you
select multiple folders, it's like selecting multiple files. If you compress that, you're
going to get archive.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 2,000
others that support MacMost at Patreon. You get exclusive content, course discounts, and more.
You can read about it at macmost.com slash 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's 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 compress and delete those. 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've 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 and you can see
it expands it, in this case, giving you the archive folder here, which was created because
you zipped up three files. So it created the archive folder for you and if you look inside,
you'll see the files in there. Notice it didn't get rid of the .zip file. That's still there.
So if your intention is to simply expand it and not need the zip file anymore, you're going 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 and there's a setting for that as well, which I'll show you in a minute.
Then 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 and that's
the app called Archive Utility. I'm going to use Spotlight and search for it and 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 find you can't. If you hold
the Command key down, you can't select a second file. 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 and 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. 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 could also specify a
special folder for all zip files to expand into if you'd like. In addition, after expanding you
could set it to leave the Archive alone, which is what it does. By default, the zip file stays there,
but you could 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
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 and 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 zip files uses these settings, which do not change how the Finder works. You can change
where the archives are saved to have them go into a special folder, but it only works in Archive
Utility here. You can change the format and instead of using the standard zip file format, you could
use Unix and Linux formats here or special Apple formats. The only reasons you won't want to use
these is maybe if you're a developer, you're working with special types of files that zip
archives 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's just that these
Apple archives only work on a Mac. If you send them to somebody that's using Windows, then they
won't be able to open them up. And in addition, the last option here actually will create an
Apple archive that's 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
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 Finder, but you can do it in Terminal. Even if
you're not comfortable using the Terminal for other things, it's very easy to use it for this.
So I've launched the 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 and drop that into the Terminal window. And that will put the entire path here,
even using backslashes as part 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 .zip after this, or just leave that out and it'll put it in for you,
and then put the name of the file that you want to include. So I'll just start typing balances,
and I can use tab to autocomplete. Now I press return, and it's going to create this Archive.zip.
I have something just like if I were to have ctrl clicked on this and compressed, and then rename
the zip file afterwards. But I could 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.txt, and maybe this photo here, and it's going to put
all three of those into this. I can also use wildcards. So I can do zip space, and I can do
asterisk.txt, and that will zip up all the files it finds that match that wildcard 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 backsplashes for spaces. It's a little nicer, I think, to use double quotes,
and then you can include spaces inside the double quotes like that. And 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 "-r". "-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 "-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 a zip, and you would do "-r", for recursive, but also "-e", for encrypted. Now you give it a
name, so I'll do archive4, and then you list the files or put the folders here. So I'll just do,
say, two files like that, and then return, and it's going to prompt me now for a password.
I'll enter that password in, it'll ask me to verify, and now it creates this archive here
that I know is password protected. Now, opening a zip file that's 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's password protected and encrypted doesn't require terminal, only
making it does. And if you really want to do more using the terminal here, note that you can type
man for manual, and then zip, and 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. I hope you found this useful. Thanks for watching.
