Command Line Switches

Syntax

<switch>::= -<switch_characters>[<option>]

On the command line, a switch consists of a switch specifier, either a dash (-) or a forward slash (/), followed by the name of the switch. Switch names cannot be abbreviated.

Some switches take an argument after the switch name. No spaces or tabs are allowed within a switch specification. Switch names are not case sensitive, but arguments can be case sensitive.

Switch can be used in any place in command line.

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

Switch quick reference

SwitchDescription
-- Stop switches and @listfile parsing
-ad Show dialog box in GUI version (7zg)
-ai Include archive filenames
-an Disable parsing of archive_name
-ao Overwrite mode
-ax Exclude archive filenames
-ba disable headers in standard output log
-bb[0-3] Set output log level
-bd Disable progress indicator
-bs{o|e|p}{0|1|2} Set output stream for output/error/progress
-bt Show execution time statistics
-i Include filenames
-m Set Compression Method
-o Set Output directory
-p Set Password
-r Recurse subdirectories
-sa Set Archive name mode
-scc Set charset for for console input/output
-scrc Set hash function
-scs Set charset for list files
-sdel Delete files after including to archive
-seml Send archive by email
-sfx Create SFX archive
-shd{dir_path} Set the base directory that is used to check files referenced by hash (sha256) files
-si Read data from StdIn
-slp Set Large Pages mode
-slt Show technical information
-slf[h][s][n] Set fields (columns) that must be printed in h (hash) command: h (hash), s (size), n (name)
-slmu Show timestamps as UTC instead of LOCAL TIME
-slsl[-] Show paths with linux path separator (slash '/') instead of windows path separator (backslash '\')
-smemx{size}g Set allowed memory usage limit for RAR archive unpacking. RAR archives can use dictionary up 64 GB. Default allowed limit for RAR unpacking is 4 GB.
-sni Store NT security information
-sns Store NTFS alternate Streams
-snt[-] Replace trail dots and spaces in file names for Extract operation
-snc Extract file as alternate stream, if there is ':' character in name
-snr Replace ':' character to '_' character in paths of alternate streams
-snh Store hard links as links (WIM and TAR formats only)
-snl Store symbolic links as links (WIM and TAR formats only)
-snld allow extracting of denagerous symbolic links.
-snoi store owner id in archive, extract owner id from archive (tar/Linux)
-snon store owner name in archive (tar/Linux)
-snz propagate Zone.Identifier stream for extracted files (Windows)
-so Write data to StdOut
-spd Disable wildcard matching for file names
-spe Eliminate duplication of root folder for extract archive command
-spf Use fully qualified file paths
-spm Require path separator mark for directory path
-ssc Set Sensitive Case mode
-sse Stop archive creating, if 7-Zip can't open some input file
-ssp Do not modify "Last Access Time" property of source files when archiving or hashing
-ssw Compress files open for writing
-stl Set archive timestamp from the most recently modified file
-stm{HexMask} Set CPU thread affinity mask (hexadecimal number).
-stx{Type} Exclude archive type
-t Type of archive
-u Update options
-v Create Volumes
-w Set Working directory
-x Exclude filenames
-y Assume Yes on all queries