7za
Create and extract archives
TLDR
[a]rchive a file or directory
Encrypt an existing archive (including file names)
E[x]tract an archive preserving the original directory structure
E[x]tract an archive to a specific directory
E[x]tract an archive to stdout
[a]rchive using a specific archive type
[l]ist the contents of an archive
Set the level of compression (higher means more compression, but slower)
SYNOPSIS
7za <command> [switches...] [<archive>] [<file_names>...]
e.g., 7za a archive.7z files/
PARAMETERS
a
Add files to archive (create or update)
d
Delete files from archive
e
Extract from archive (no full paths)
l
List archive contents (short)
ls
List archive contents (detailed)
t
Test archive integrity
u
Update existing archive
x
eXtract with full paths
-t{Type}
Set archive type: 7z, zip, gzip, bzip2, xz, tar
-mx={0-9}
Compression level: 0 (store) to 9 (ultra)
-p{Password}
Set password for encryption
-r
Recurse subdirectories
-slt
Set archive timestamp from latest file
-ssw
Compress shared files
-v{Size}[b|k|m|g]
Create volumes of specified size
-y
Assume Yes to all queries
-ao{a|s}
Overwrite: a (append), s (skip)
DESCRIPTION
7za is a standalone command-line version of 7-Zip, a free open-source file archiver with high compression ratios. It supports formats like 7z, XZ, BZIP2, GZIP, TAR, and ZIP. Designed for Unix-like systems, it's part of the p7zip package and excels in creating and extracting archives efficiently.
Key features include strong AES-256 encryption, solid archives for better compression, and LZMA/LZMA2 algorithms. Use it to add, extract, list, test, or update files in archives. It's lightweight, requiring no full 7-Zip installation, and handles large files well. Ideal for scripts, backups, and cross-platform archiving.
Common operations: compress directories into .7z files surpassing ZIP/GZIP ratios, or extract with full paths. Benchmarks show superior speed and size reduction compared to traditional tools.
CAVEATS
Unix version lacks self-extracting (SFX) support; limited Windows-specific formats like WIM. Password prompts insecure in scripts. High compression (-mx=9) is CPU-intensive. No Unicode paths on older systems.
SUPPORTED FORMATS
Packing: 7z, xz, zip, gzip, bzip2, tar.
Unpacking: 7z, xz, zip, gzip, bzip2, tar, Z, lzma.
EXAMPLE USAGE
7za a -t7z -mx9 -psecret backup.7z /home/user/
Compresses directory with ultra compression and password.
7za x archive.7z -o/output/dir
Extracts to specified directory.
HISTORY
Developed by Igor Pavlov as part of 7-Zip (1999). p7zip port (2004) added Unix support; 7za is standalone executable from p7zip-full. Evolved with LZMA2 (v4.57+), remains actively maintained for POSIX systems.


