7-Zip Manual

Documents 7-Zip 26.04

All documents
Start and general
  • 7-Zip Start Page
  • General Information
  • 7z Format
  • Frequently Asked Questions (FAQ)
  • Supported formats
  • License for use and distribution
  • Performance
  • Thanks
File Manager
  • 7-Zip File Manager
  • About Dialog Box
  • Benchmark
  • Menu Items and Shortcut Keys
  • Options Dialog Box
  • Delete Temporary Files
File Manager plugins
  • 7-Zip Plugin
  • Plugins
  • Add to Archive Dialog Box
  • Extract Dialog Box
Command line: overview
  • Command Line Version User's Guide
  • Exit Codes from 7-Zip
  • Command Line Syntax
Command line: commands
  • Command Line Commands
  • a (Add) command
  • b (Benchmark) command
  • d (Delete) command
  • e (Extract without folders) command
  • x (Extract with full paths) command
  • h (Hash) command
  • l (List contents of archive) command
  • rn (Rename) command
  • t (Test integrity of archive) command
  • u (Update) command
Command line: switches
  • Command Line Switches
  • -ax (Exclude archive filenames) switch
  • -ai (Include archive filenames) switch
  • -an (Disable parsing of archive_name) switch
  • -bb (Set output log level) switch
  • -bs (Set output stream for output/error/progress line) switch
  • -scs (Set charset for list files) switch
  • -seml (Send archive by email) switch
  • -x (Exclude filenames) switch
  • -i (Include filenames) switch
  • -slp (Set Large Pages mode) switch
  • -slt (Show technical information) switch
  • -m (Set compression Method) switch
  • -o (set Output directory) switch
  • -ao (Overwrite mode) switch
  • -p (set Password) switch
  • -r (Recurse subdirectories) switch
  • -sa (set Archive name mode) switch
  • -scc (Set charset for console input/output) switch
  • -scrc (Set hash function) switch
  • -sdel (Delete files after including to archive) switch
  • -sfx (Create SFX archive) switch
  • -ssw (Compress files open for writing) switch
  • -sni (Store NT security information) switch
  • -sns (Store NTFS alternate Streams) switch
  • -spf (Use fully qualified file paths) switch
  • -spm (Require path separator mark for directory path) switch
  • -ssc (Set Sensitive Case mode) switch
  • -si (read data from stdin) switch
  • -so (write data to stdout) switch
  • -stl (Set archive timestamp from the most recently modified file) switch
  • -- (Stop switches parsing) switch
  • -stx (Exclude archive type) switch
  • -t (set Type of archive) switch
  • -u (Update options) switch
  • -v (Create Volumes) switch
  • -w (set Working directory) switch
  • -y (assume Yes on all queries) switch
Text files
  • 7zC.txt
  • 7zFormat.txt
  • License.txt
  • Methods.txt
  • copying.txt
  • lzma.txt
  • readme.txt
  • src-history.txt
  • unRarLicense.txt
  1. 7-Zip Manual
  2. Command Line Commands

Command Line Commands

The command is the first non-switch argument on the command line.

Command names are not case sensitive.

See also Command Line Syntax for more details about using the command line.

Commands quick reference

CommandDescription
a Add
b Benchmark
d Delete
e Extract
h Hash
i Show information about supported formats
l List
rn Rename
t Test
u Update
x eXtract with full paths

Notes from this site

Not part of the 7-Zip manual. Written by this site; examples checked with 7-Zip 26.04.

Quick examples

On Windows the program is 7z.exe. The official Linux and macOS console binary is 7zz. The manual writes 7z everywhere, so use 7zz there. Some Linux packages install other names such as 7z too; check with command -v 7zz 7z. Running 7zz with no arguments prints the version and a usage summary. See command line syntax.

7zz a x.7z folder                 # create (or add to) an archive
7zz a -mx=9 x.7z folder            # smaller archive, slower (levels: see -m)
7zz a -tzip x.zip folder           # same, as a zip
7zz a -p -mhe=on x.7z folder       # password; also encrypts file names (7z only)
7zz x x.7z -oout                   # extract into the folder out, keeping paths
7zz x x.7z folder/b.doc -oout      # extract one file (path as shown by l)
7zz l x.7z                         # list contents
7zz t x.7z || echo BAD             # test; exit code 2 on damage
7zz i | less                       # formats, codecs and hashers in your build

Compression levels are explained on the -m page, more create variants on a (Add), and single files on x. Scripts should check exit codes, not the text.

Which command do I need?

  • a creates or adds; u adds only new and changed files.
  • x extracts with folders (usual choice); e puts everything in one flat folder. Choose the target with -o.
  • l shows contents; t checks for damage.
  • d and rn remove or rename entries inside an archive.
  • h gives checksums; b runs a benchmark.
  • i prints the supported Formats, Codecs and Hashers. In 26.04 the Rar rows lack the C flag: 7-Zip reads RAR but cannot create it.

Common mistakes

  • Using e on an archive with folders: two files named n.txt from different folders collide, and with -y the later one replaces the earlier one.
  • Running x in a script without -y or -ao: an existing file triggers a prompt and the script stops. -aou keeps both; the second becomes n_1.txt.
  • a, u, d and rn rewrite the archive, so keep a backup of anything important.
Nexta (Add) command

This is an unofficial mirror of the 7-Zip documentation. This site is not affiliated with, endorsed by, or sponsored by 7-Zip or its authors. The documentation (7-Zip 26.04) is copyright © 1999-2026 Igor Pavlov and any other rights holders, and is licensed under the GNU LGPL.

Source: 7-zip.org (downloads and current release). The 7-Zip text is unmodified; only the page layout is changed. Boxes titled “Notes from this site” are written by this site and are not part of the 7-Zip manual.