When exchanging files from Window computer users, it would be nice ifa Mac user could create a zip archive files from the command line thatsupport the WinZip AES256 encryption scheme. Thebuilt in zip and unzip tools that come with Mac OS X only supportthe weaker WinZip/PKZip encryption process.

Mac OS X will unpack a.tar.gz,.tar, or.zip file automatically when you double-click on its icon. (Note that it may be necessary to unpack some files twice.) If you would rather follow the UNIX-style instructions below you can use the Terminal command-line application, which can be found in your Utilities folder. I try to unzip a file via CMD. So I install WinZip (and its plugin to cmd), WinRAR, and 7-zip. But when I try to execute a command via the CMD: 7z e myzip.zip It gives the next error: 7z is not.

Regular Zip Archives

To create a zip archive file from the command line is pretty straightforward. Lets say you have a file called resume.txt and you wouldlike to wrap it up in a zip archive, the command would be.

If you wanted to add additional file to the archive, you would addthe filenames to the end of the same command.

To pull a zip archive file list, run the unzipcommand with the list -l option.

All of these commands are handy, but they will not help us when weneed to work with zip archives using the more updated AES256encryption scheme.

AES256 Encrypted Zip Files

Using Homebrew, one can install the Posix port of the 7-zip project,which does support the WinZip AES256 encryption scheme.

Once installed, run the command 7za to access the program. Thecommand below builds a new AES256 encrypted zip archive with thepassword “cookie77MONSTER”.

To get a list of the contents, run either the unzip -l command or the 7za l.

The unzip command reports as follows.

GUI Clients

If you would prefer using a GUI client, WinZip sells a nice Mac version for $30 USD.
The encryption scheme defaults to the older version, so be sure to select the AES256 option in the preference window.

— Chris

Unzip 7z Mac Command Line Tool

7-Zip is a file archiver with a high compression ratio.

Download 7-Zip 19.00 (2019-02-21) for Windows:

LinkTypeWindowsSize
Download.exe64-bit x641.4 MB
Download.exe32-bit x861.2 MB

Unzip 7z Mac Command Line Prompt

Unzip 7z Mac Command Line

Download 7-Zip 21.03 beta (2021-07-20) for Windows:

LinkTypeWindowsSize
Download.exe64-bit x641.4 MB
Download.exe32-bit x861.2 MB
Download.exe64-bit ARM641.5 MB

License

7-Zip is free software with open source. The most of the code is under the GNU LGPL license. Some parts of the code are under the BSD 3-clause License. Also there is unRAR license restriction for some parts of the code. Read 7-Zip License information.

You can use 7-Zip on any computer, including a computer in a commercial organization. You don't need to register or pay for 7-Zip.

The main features of 7-Zip

  • High compression ratio in 7z format with LZMA and LZMA2 compression
  • Supported formats:
    • Packing / unpacking: 7z, XZ, BZIP2, GZIP, TAR, ZIP and WIM
    • Unpacking only: AR, ARJ, CAB, CHM, CPIO, CramFS, DMG, EXT, FAT, GPT, HFS, IHEX, ISO, LZH, LZMA, MBR, MSI, NSIS, NTFS, QCOW2, RAR, RPM, SquashFS, UDF, UEFI, VDI, VHD, VMDK, WIM, XAR and Z.
  • For ZIP and GZIP formats, 7-Zip provides a compression ratio that is 2-10 % better than the ratio provided by PKZip and WinZip
  • Strong AES-256 encryption in 7z and ZIP formats
  • Self-extracting capability for 7z format
  • Integration with Windows Shell
  • Powerful File Manager
  • Powerful command line version
  • Plugin for FAR Manager
  • Localizations for 87 languages

7-Zip works in Windows 10 / 8 / 7 / Vista / XP / 2019 / 2016 / 2012 / 2008 / 2003 / 2000.

p7zip - the port of the command line version of 7-Zip to Linux/Posix.

On 7-Zip's SourceForge Page you can find a forum, bug reports, and feature request systems.

Compression ratio

We compared 7-Zip with WinRAR 5.20.

Unzip 7z Mac Command Liner

FILE SETS: Mozilla Firefox 34.0.5 for Windows and Google Earth 6.2.2.6613 for Windows.

7z Mac

ArchiverMozilla FirefoxGoogle Earth
65 files
85 280 391 bytes
483 files
110 700 519 bytes
Compressed sizeRatioCompressed sizeRatio
7-Zip 9.35
-mx
39 357 375100%15 964 369100%
WinRAR 5.20
-m5 -s -ma5 -md128m
41 789 543106%17 035 432107%

Compression ratio results are very dependent upon the data used for the tests. Usually, 7-Zip compresses to 7z format 30-70% better than to zip format. And 7-Zip compresses to zip format 2-10% better than most of other zip compatible programs.