17za(1) General Commands Manual 7za(1)
2
3
4
6 7za - A file archiver with highest compression ratio
7
9 7za [adeltux] [-] [SWITCH] <ARCHIVE_NAME> <ARGUMENTS>...
10
12 7-Zip is a file archiver with the highest compression ratio. The pro‐
13 gram supports 7z (that implements LZMA compression algorithm), ZIP,
14 CAB, ARJ, GZIP, BZIP2, TAR, CPIO, RPM and DEB formats. Compression
15 ratio in the new 7z format is 30-50% better than ratio in ZIP format.
16
17 7za is a stand-alone executable. 7za handles less archive formats than
18 7z, but does not need any others.
19
21 a Add
22
23 d Delete
24
25 e Extract
26
27 l List
28
29 t Test
30
31 u Update
32
33 x eXtract with full paths
34
36 -ai[r[-|0]]{@listfile|!wildcard}
37 Include archives
38
39 -ax[r[-|0]]{@listfile|!wildcard}
40 eXclude archives
41
42 -bd Disable percentage indicator
43
44 -i[r[-|0]]{@listfile|!wildcard}
45 Include filenames
46
47 -l don't store symlinks; store the files/directories they point to
48 (CAUTION : the scanning stage can never end because of recursive
49 symlinks like 'ln -s .. ldir')
50
51 -m{Parameters}
52
53 -mhe=on|off
54 7z format only : enables or disables archive header encryption
55 (Default : off)
56
57 -o{Directory}
58 Set Output directory
59
60 -p{Password}
61 Set Password
62
63 -r[-|0]
64 Recurse subdirectories (CAUTION: this flag does not do what you
65 think, avoid using it)
66
67 -sfx[{name}]
68 Create SFX archive
69
70 -si Read data from StdIn (eg: tar cf - directory | 7za a -si direc‐
71 tory.tar.7z)
72
73 -so Write data to StdOut (eg: % echo foo | 7z a dummy -tgzip -si -so
74 > /dev/null)
75
76 -slt Sets technical mode for l (list) command
77
78 -t{Type}
79 Type of archive (7z, zip, gzip, bzip2 or tar. 7z format is
80 default)
81
82 -v{Size}[b|k|m|g]
83 Create volumes
84
85 -u[-][p#][q#][r#][x#][y#][z#][!newArchiveName]
86 Update options
87
88 -w[path]
89 Set Working directory
90
91 -x[r[-|0]]]{@listfile|!wildcard}
92 Exclude filenames
93
94 -y Assume Yes on all queries
95
97 7-Zip returns the following exit codes:
98
99 0 Normal (no errors or warnings detected)
100
101 1 Warning (Non fatal error(s)). For example, some files
102 cannot be read during compressing. So they were not com‐
103 pressed
104
105 2 Fatal error
106
107 7 Bad command line parameters
108
109 8 Not enough memory for operation
110
111 255 User stopped the process with control-C (or similar)
112
114 DO NOT USE the 7-zip format for backup purpose on Linux/Unix because :
115 - 7-zip does not store the owner/group of the file.
116
117
118 On Linux/Unix, in order to backup directories you must use tar :
119 - to backup a directory : tar cf - directory | 7za a -si direc‐
120 tory.tar.7z
121 - to restore your backup : 7za x -so directory.tar.7z | tar xf -
122
123 If you want to send files and directories (not the owner of file) to
124 others Unix/MacOS/Windows users, you can use the 7-zip format.
125
126 example : 7za a directory.7z directory
127
128
129 Do not use "-r" because this flag does not do what you think.
130
131 Do not use directory/* because of ".*" files (example : "directory/*"
132 does not match "directory/.profile")
133
135 7za a -t7z -m0=lzma -mx=9 -mfb=64 -md=32m -ms=on archive.7z dir1
136 adds all files from directory "dir1" to archive archive.7z using
137 "ultra settings"
138
139 -t7z 7z archive
140
141 -m0=lzma
142 lzma method
143
144 -mx=9 level of compression = 9 (Ultra)
145
146 -mfb=64
147 number of fast bytes for LZMA = 64
148
149 -md=32m
150 dictionary size = 32 megabytes
151
152 -ms=on solid archive = on
153
155 7za a -sfx archive.exe dir1
156 add all files from directory "dir1" to SFX archive archive.exe
157 (Remark : SFX archive MUST end with ".exe")
158
160 7za a -mhe=on -pmy_password archive.7z a_directory
161 add all files from directory "a_directory" to the archive "ar‐
162 chive.7z" (with data and header archive encryption on)
163
165 7z(1), 7zr(1), bzip2(1), gzip(1), zip(1)
166
169 Written for Debian by Mohammed Adnene Trojette.
170
171
172
173Mohammed Adnene Trojette September 1 2006 7za(1)