7zip Mac Terminal

On the download page of 7-zip, there are several options for OS X. Unfortunately, they seem to be with a GUI, or not available at the moment. You can download p7zip though. P7zip is the command line version of 7-Zip for Unix/Linux, made by an independent developer. MacOS does not handle the.7z format natively. The UnArchiver is my favourite tool for handling.7z and many other formats. It is available as both an application and a command line tool if that is how you prefer to operate.

KB ID 0001357

Problem

Me to the office: Does anyone know how to create a password protected Zip file on a Mac?

Reply: Use Windows

Well actually this advice is ‘bobbins!’ Windows still can’t do this without installing an application, (I would recommend 7-Zip). But with a Mac of course you can 🙂

Solution

First open an Terminal window, then ‘change directory’ to the folder that contains the uncompressed file(s), or folder(s) you want to Zip.

Changing Directory With Spaces In Your Foldernames

I thought I’d better put this here, if you have spaces in your folder names, you use the following syntax;

And repeat if you have multiple spaces like so;

Mac OSX: Create a Normal Zip File

Before we try and password protect a Zip, file let’s see how to create a simple one;

zip -r {Archive-Name}.zip {Folder-or-Filename-To-Add}

Mac OSX: Adding Password Protection To Zip Files

7zip Mac Terminal Login

Use the following syntax;

zip -e {Archive-Name7zip Mac Terminal

Unzip On Mac

Unzip}.zip {Folder-or-Filename-To-Add}

Enter and Confirm The Password

Related Articles, References, Credits, or External Links

7-zip

NA