7z
high-compression file archiver supporting multiple formats
TLDR
Create archive
SYNOPSIS
7z command [switches] archive [files...]
DESCRIPTION
7z is the command-line interface to the 7-Zip archiver, supporting many formats: 7z, ZIP, TAR, GZIP, BZIP2, XZ, and more.
The 7z format offers high compression ratios using LZMA/LZMA2 algorithms, often 30-70% better than ZIP. It also supports AES-256 encryption and multi-volume archives.
Extraction supports many additional formats including RAR, CAB, ISO, and others (read-only for some formats).
PARAMETERS
-odir
Output directory (no space after -o)-ppassword
Set password-mx=n
Compression level (0=store, 9=ultra)-ttype
Archive type (7z, zip, tar, gzip, bzip2)-mhe=on
Encrypt filenames (7z format)-r
Recurse subdirectories-y
Assume yes to all queries-vsize
Create volumes (e.g., -v100m)
COMMANDS
a
Add files to archivex
Extract with full pathse
Extract (flat, no paths)l
List archive contentst
Test archive integrityd
Delete from archiveu
Update archive
CAVEATS
The 7z format is not as universally supported as ZIP. Consider ZIP for maximum compatibility.
-o has no space: -o/path not -o /path.
RAR creation requires separate RAR tools. 7z can only extract RAR files.
Split archives (-v) require all volumes for extraction.
