7-Zip is a powerful, free, and open-source file archiver that offers the highest compression ratio among similar tools. It supports multiple formats and provides strong AES-256 encryption for your sensitive files.

CLI reference

It is not standard like zip but it offers more secure encryption.

Install

See Download page. Or see below.

Note there are variations of 7Zip as 7z and 7zz, because of a fork.

If you have it installed as 7zz, you can add an alias:

alias 7z='7zz'

macoS

brew install sevenzip

Reco

Ubuntu/Debian

sudo apt install 7zip

Don’t use p7zip-full as it is not maintained.

CLI

Create archive

7zz [OPTIONS] ZIP_FILE SOURCE

e.g.

7zz a -p -mhe=on my_archive.7z my_folder/

Extract

Note you don’t have to specify the output name and it removes .7z for you.

7zz x ZIP_FILE

Or custom:

7zz x ZIP_FILE -o OUTPUT_PATH