7-Zip

Compresses hard, and reads and writes many formats

About

The command-line face of the 7-Zip archiver, shipped in Termux as p7zip. It handles its own format plus ZIP, gzip and others, and often compresses better than the older tools. Reach for it when archive size matters, or when one program must cover several formats.

Install it

pkg install p7zip

Run this inside Termux. If the package is already present, pkg will say so and do nothing.

Commands worth knowing

6 of the invocations you will actually reach for. Tap the copy button to put one on your clipboard.

7z a backup docs/ Create or update an archive from a folder, format chosen by extension.
7z l backup List the members of an archive without unpacking it.
7z x backup -o/sdcard/out Extract into the given output directory, keeping the internal structure.
7z e backup Extract and flatten paths, so every member lands in one directory.
7z t backup Verify an archive and report any corruption.
7z a -mx=9 photos Pictures/ Pack with maximum compression. Slower, but the result is smaller.

Worked example

Run 7z l backup and this is what you should see.

termux
$ 7z l backup
Scanning the drive for archives
   Date      Time    Attr         Size   Compressed  Name
----------- -------- ---------- ---------- ----------- ----------------
2026-10-20 11:30 ....A         1024          512  readme.txt
2026-10-20 11:31 ....A         8192         2048  docs/guide.md

Developed by

Igor Pavlov .