.TH P7ZIP 1 "September 1 2006"
.SH NAME
7\-Zip \- A set of archivers that provide high compression ratios
.SH SYNOPSIS
7z [adeltux] [\-] [switches] archive\-name arg1 arg2 ...
.PP
.SH DESCRIPTION
7z, 7za, and 7zr are file archivers that provide high compression
ratios. The three programs do essentially the same thing, with the
following differences:

7z supports more formats than 7za, but it relies on external
utilities, which may or may not be available. 7za and 7zr support
fewer formats than 7z, but on most distros they're stand\-alone
programs.

7z supports the following formats: 7z (the program's native format),
ZIP, CAB, ARJ, GZIP, BZIP2, TAR, CPIO, RPM and DEB. 7za supports a
subset of these formats. Most versions of 7zr are limited to the
native 7z format.

Note: The 7z format achieves compression ratios that are 30% to 50%
better than ZIP ratios for comparable input files.
.PP
.SH FUNCTION LETTERS
.TP
.B a
Add
.TP
.B d
Delete
.TP
.B e
Extract
.TP
.B l
List
.TP
.B t
Test
.TP
.B u
Update
.TP
.B x
eXtract with full paths
.PP
.SH SWITCHES
.TP
.B \-ai[r[\-|0]]{@listfile|!wildcard}
Include archives
.TP
.B \-ax[r[\-|0]]{@listfile|!wildcard}
eXclude archives
.TP
.B \-bd
Disable percentage indicator
.TP
.B \-i[r[\-|0]]{@listfile|!wildcard}
Include filenames
.TP
.B \-l
Don't store symlinks. Instead, store the files/directories they point
to. Warning: If you try to back\-up a directory that contains strange
recursive symlinks, and you use \-l, the 7z programs may hang.
.TP
.B \-m{Parameters}
Set Compression Method

For a list of methods, see:

__META_PREFIX__/doc/p7zip/DOCS/MANUAL/switches/method.htm
.TP
.B \-mhe=on|off
7z format only: enables or disables archive header encryption
(Default : off)
.TP
.B \-o{Directory}
Set Output directory
.TP
.B \-p{Password}
Set Password
.TP
.B \-r[\-|0]
This is an undocumented option.
.TP
.B \-sfx[{name}]
Create SFX archive
.TP
.B \-si
Read data from StdIn (eg: tar cf \- directory | 7z a \-si directory.tar.7z)
.TP
.B \-so
Write data to StdOut (eg: % echo foo | 7z a dummy \-tgzip \-si \-so > /dev/null)
.TP
.B \-slt
Sets technical mode for l (list) command
.TP
.B \-t{Type}
Type of archive: 7z, zip, gzip, bzip2 or tar. The default is 7z.
.TP
.B \-v{Size}[b|k|m|g]
Create volumes
.TP
.B \-u[\-][p#][q#][r#][x#][y#][z#][!newArchiveName]
Update options
.TP
.B \-w[path]
Set Working directory
.TP
.B \-x[r[\-|0]]]{@listfile|!wildcard}
Exclude filenames
.TP
.B \-y 
Assume Yes on all queries
.PP
.SH DIAGNOSTICS
7\-Zip returns the following exit codes:
.RS
.IP 0
Normal (no errors or warnings detected)
.IP 1
Warning (Non fatal error(s)). For example, some files cannot be read during compressing. So they were not compressed
.IP 2
Fatal error
.IP 7
Bad command line parameters
.IP 8
Not enough memory for operation
.IP 255
User stopped the process with control\-C (or similar)

.SH BUGS AND RESTRICTIONS
If you'd like to back\-up a directory tree with one of the 7z
programs, you should normally use commands similar to the
following:

to back\-up a directory : tar cf \- directory | 7za a \-si directory.tar.7z
to restore your backup : 7za x \-so directory.tar.7z | tar xf \-

Reason: The 7z format doesn't store Linux owner/group numbers. The
"tar"-based approach shown here bypasses the problem.

If you don't care about owner/group numbers, you can use one of
the 7z programs to back\-up a directory tree directly (without
"tar"). For example:

    7za a directory.7z directory
.LP
Don't use the "\-r" option switch unless you're already familiar with
the switch.
.SH EXAMPLE 1
.TP
.B 7z a \-t7z  \-m0=lzma \-mx=9 \-mfb=64 \-md=32m \-ms=on archive.7z  dir1
adds all files from directory "dir1" to archive archive.7z using "ultra settings"
.TP
.B \-t7z
7z archive
.TP
.B \-m0=lzma
lzma method
.TP
.B \-mx=9
level of compression = 9 (Ultra)
.TP
.B \-mfb=64
number of fast bytes for LZMA = 64
.TP
.B \-md=32m
dictionary size = 32 megabytes
.TP
.B \-ms=on
solid archive = on
.SH EXAMPLE 2
.TP
.B
7z a \-sfx archive.exe dir1
add all files from directory "dir1" to SFX archive archive.exe (Remark : SFX archive MUST end with ".exe")
.SH EXAMPLE 3
.TP
.B
7z a \-mhe=on \-pmy_password archive.7z a_directory
add all files from directory "a_directory" to the archive "archive.7z" (with data and header archive encryption on)
.SH "SEE ALSO"
.BR 7zr (1)
