Skip to main content
7-Zip supports a comprehensive set of command-line operations for working with archives. Each command is specified as a single letter or word following the 7z executable.

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:
string
Set output directory for extraction
string
Set password for encrypted archives
string
Set archive type (7z, zip, tar, etc.)
flag
Recurse subdirectories
number
Set compression level (0=store, 1=fastest, 5=normal, 9=ultra)
number
Set number of CPU threads
flag
Assume Yes on all queries
flag
Disable progress indicator
number
Set output log level

Exit Codes

7-Zip uses the following exit codes:

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.
Use 7z --help to display the full help message with all commands and switches.