Command Syntax
Available Commands
Add (a)
Add files to archive
Update (u)
Update files to archive
Delete (d)
Delete files from archive
Extract (x, e)
Extract files from archive
List (l)
List contents of archive
Test (t)
Test integrity of archive
Benchmark (b)
Benchmark compression performance
Hash (h)
Calculate hash values for files
Rename (rn)
Rename files in archive
Info (i)
Show supported formats and codecs
Command Categories
Archive Creation & Update
- a (Add) - Create new archives or add files to existing ones
- u (Update) - Update files in archive with newer versions
- d (Delete) - Remove files from archives
Archive Extraction
- x (Extract with full paths) - Extract files preserving directory structure
- e (Extract) - Extract files to current directory without paths
Archive Information
- l (List) - Display archive contents and metadata
- t (Test) - Verify archive integrity without extraction
Utilities
- b (Benchmark) - Test system compression/decompression performance
- h (Hash) - Calculate checksums (CRC32, SHA256, etc.)
- i (Info) - Show supported formats and codecs
Common Switches
Most commands support these common switches:Set output directory for extraction
Set password for encrypted archives
Set archive type (7z, zip, tar, etc.)
Recurse subdirectories
Set compression level (0=store, 1=fastest, 5=normal, 9=ultra)
Set number of CPU threads
Assume Yes on all queries
Disable progress indicator
Set output log level
Exit Codes
7-Zip uses the following exit codes:| Code | Meaning |
|---|---|
| 0 | Normal (no errors or warnings) |
| 1 | Warning (non-fatal errors) |
| 2 | Fatal error |
| 7 | Command line error |
| 8 | Not enough memory |
| 255 | User stopped the process |
Examples
Create an archive
Extract an archive
List archive contents
Test archive integrity
Command letters are case-insensitive. Both
7z a and 7z A work the same.