| 1 |
.\" Copyright (c) 1990-2009 Info-ZIP. All rights reserved. |
| 2 |
.\" |
| 3 |
.\" See the accompanying file LICENSE, version 2009-Jan-02 or later |
| 4 |
.\" (the contents of which are also included in unzip.h) for terms of use. |
| 5 |
.\" If, for some reason, all these files are missing, the Info-ZIP license |
| 6 |
.\" also may be found at: ftp://ftp.info-zip.org/pub/infozip/license.html |
| 7 |
.\" |
| 8 |
.\" unzip.1 by Greg Roelofs, Fulvio Marino, Jim van Zandt and others. |
| 9 |
.\" |
| 10 |
.\" ========================================================================= |
| 11 |
.\" define .EX/.EE (for multiline user-command examples; normal Courier font) |
| 12 |
.de EX |
| 13 |
.in +4n |
| 14 |
.nf |
| 15 |
.ft CW |
| 16 |
.. |
| 17 |
.de EE |
| 18 |
.ft R |
| 19 |
.fi |
| 20 |
.in -4n |
| 21 |
.. |
| 22 |
.\" ========================================================================= |
| 23 |
.TH UNZIP 1 "20 April 2009 (v6.0)" "Info-ZIP" |
| 24 |
.SH NAME |
| 25 |
unzip \- list, test and extract compressed files in a ZIP archive |
| 26 |
.PD |
| 27 |
.SH SYNOPSIS |
| 28 |
\fBunzip\fP [\fB\-Z\fP] [\fB\-cflptTuvz\fP[\fBabjnoqsCDKLMUVWX$/:^\fP]] |
| 29 |
\fIfile\fP[\fI.zip\fP] [\fIfile(s)\fP\ .\|.\|.] |
| 30 |
[\fB\-x\fP\ \fIxfile(s)\fP\ .\|.\|.] [\fB\-d\fP\ \fIexdir\fP] |
| 31 |
.PD |
| 32 |
.\" ========================================================================= |
| 33 |
.SH DESCRIPTION |
| 34 |
\fIunzip\fP will list, test, or extract files from a ZIP archive, commonly |
| 35 |
found on MS-DOS systems. The default behavior (with no options) is to extract |
| 36 |
into the current directory (and subdirectories below it) all files from the |
| 37 |
specified ZIP archive. A companion program, \fIzip\fP(1), creates ZIP |
| 38 |
archives; both programs are compatible with archives created by PKWARE's |
| 39 |
\fIPKZIP\fP and \fIPKUNZIP\fP for MS-DOS, but in many cases the program |
| 40 |
options or default behaviors differ. |
| 41 |
.PD |
| 42 |
.\" ========================================================================= |
| 43 |
.SH ARGUMENTS |
| 44 |
.TP |
| 45 |
.IR file [ .zip ] |
| 46 |
Path of the ZIP archive(s). If the file specification is a wildcard, |
| 47 |
each matching file is processed in an order determined by the operating |
| 48 |
system (or file system). Only the filename can be a wildcard; the path |
| 49 |
itself cannot. Wildcard expressions are similar to those supported in |
| 50 |
commonly used Unix shells (\fIsh\fP, \fIksh\fP, \fIcsh\fP) and may contain: |
| 51 |
.RS |
| 52 |
.IP * |
| 53 |
matches a sequence of 0 or more characters |
| 54 |
.IP ? |
| 55 |
matches exactly 1 character |
| 56 |
.IP [.\|.\|.] |
| 57 |
matches any single character found inside the brackets; ranges are specified |
| 58 |
by a beginning character, a hyphen, and an ending character. If an exclamation |
| 59 |
point or a caret (`!' or `^') follows the left bracket, then the range of |
| 60 |
characters within the brackets is complemented (that is, anything \fIexcept\fP |
| 61 |
the characters inside the brackets is considered a match). To specify a |
| 62 |
verbatim left bracket, the three-character sequence ``[[]'' has to be used. |
| 63 |
.RE |
| 64 |
.IP |
| 65 |
(Be sure to quote any character that might otherwise be interpreted or |
| 66 |
modified by the operating system, particularly under Unix and VMS.) If no |
| 67 |
matches are found, the specification is assumed to be a literal filename; |
| 68 |
and if that also fails, the suffix \fC.zip\fR is appended. Note that |
| 69 |
self-extracting ZIP files are supported, as with any other ZIP archive; |
| 70 |
just specify the \fC.exe\fR suffix (if any) explicitly. |
| 71 |
.IP [\fIfile(s)\fP] |
| 72 |
An optional list of archive members to be processed, separated by spaces. |
| 73 |
(VMS versions compiled with VMSCLI defined must delimit files with commas |
| 74 |
instead. See \fB\-v\fP in \fBOPTIONS\fP below.) |
| 75 |
Regular expressions (wildcards) may be used to match multiple members; see |
| 76 |
above. Again, be sure to quote expressions that would otherwise be expanded |
| 77 |
or modified by the operating system. |
| 78 |
.IP [\fB\-x\fP\ \fIxfile(s)\fP] |
| 79 |
An optional list of archive members to be excluded from processing. |
| 80 |
Since wildcard characters normally match (`/') directory separators |
| 81 |
(for exceptions see the option \fB\-W\fP), this option may be used |
| 82 |
to exclude any files that are in subdirectories. For |
| 83 |
example, ``\fCunzip foo *.[ch] -x */*\fR'' would extract all C source files |
| 84 |
in the main directory, but none in any subdirectories. Without the \fB\-x\fP |
| 85 |
option, all C source files in all directories within the zipfile would be |
| 86 |
extracted. |
| 87 |
.IP [\fB\-d\fP\ \fIexdir\fP] |
| 88 |
An optional directory to which to extract files. By default, all files |
| 89 |
and subdirectories are recreated in the current directory; the \fB\-d\fP |
| 90 |
option allows extraction in an arbitrary directory (always assuming one |
| 91 |
has permission to write to the directory). This option need not appear |
| 92 |
at the end of the command line; it is also accepted before the zipfile |
| 93 |
specification (with the normal options), immediately after the zipfile |
| 94 |
specification, or between the \fIfile(s)\fP and the \fB\-x\fP option. |
| 95 |
The option and directory may be concatenated without any white space |
| 96 |
between them, but note that this may cause normal shell behavior to be |
| 97 |
suppressed. In particular, ``\fC\-d\ ~\fR'' (tilde) is expanded by Unix |
| 98 |
C shells into the name of the user's home directory, but ``\fC\-d~\fR'' |
| 99 |
is treated as a literal subdirectory ``\fB~\fP'' of the current directory. |
| 100 |
.\" ========================================================================= |
| 101 |
.SH OPTIONS |
| 102 |
Note that, in order to support obsolescent hardware, \fIunzip\fP's usage |
| 103 |
screen is limited to 22 or 23 lines and should therefore be considered |
| 104 |
only a reminder of the basic \fIunzip\fP syntax rather than an exhaustive |
| 105 |
list of all possible flags. The exhaustive list follows: |
| 106 |
.TP |
| 107 |
.B \-Z |
| 108 |
\fIzipinfo\fP(1) mode. If the first option on the command line is \fB\-Z\fP, |
| 109 |
the remaining options are taken to be \fIzipinfo\fP(1) options. See the |
| 110 |
appropriate manual page for a description of these options. |
| 111 |
.TP |
| 112 |
.B \-A |
| 113 |
[OS/2, Unix DLL] print extended help for the DLL's programming interface (API). |
| 114 |
.TP |
| 115 |
.B \-c |
| 116 |
extract files to stdout/screen (``CRT''). This option is similar to the |
| 117 |
\fB\-p\fP option except that the name of each file is printed as it is |
| 118 |
extracted, the \fB\-a\fP option is allowed, and ASCII-EBCDIC conversion |
| 119 |
is automatically performed if appropriate. This option is not listed in |
| 120 |
the \fIunzip\fP usage screen. |
| 121 |
.TP |
| 122 |
.B \-f |
| 123 |
freshen existing files, i.e., extract only those files that |
| 124 |
already exist on disk and that are newer than the disk copies. By |
| 125 |
default \fIunzip\fP queries before overwriting, but the \fB\-o\fP option |
| 126 |
may be used to suppress the queries. Note that under many operating systems, |
| 127 |
the TZ (timezone) environment variable must be set correctly in order for |
| 128 |
\fB\-f\fP and \fB\-u\fP to work properly (under Unix the variable is usually |
| 129 |
set automatically). The reasons for this are somewhat subtle but |
| 130 |
have to do with the differences between DOS-format file times (always local |
| 131 |
time) and Unix-format times (always in GMT/UTC) and the necessity to compare |
| 132 |
the two. A typical TZ value is ``PST8PDT'' (US Pacific time with automatic |
| 133 |
adjustment for Daylight Savings Time or ``summer time''). |
| 134 |
.TP |
| 135 |
.B \-l |
| 136 |
list archive files (short format). The names, uncompressed file sizes and |
| 137 |
modification dates and times of the specified files are printed, along |
| 138 |
with totals for all files specified. If UnZip was compiled with OS2_EAS |
| 139 |
defined, the \fB\-l\fP option also lists columns for the sizes of stored |
| 140 |
OS/2 extended attributes (EAs) and OS/2 access control lists (ACLs). In |
| 141 |
addition, the zipfile comment and individual file comments (if any) are |
| 142 |
displayed. If a file was archived from a single-case file system (for |
| 143 |
example, the old MS-DOS FAT file system) and the \fB\-L\fP option was given, |
| 144 |
the filename is converted to lowercase and is prefixed with a caret (^). |
| 145 |
.TP |
| 146 |
.B \-p |
| 147 |
extract files to pipe (stdout). Nothing but the file data is sent to |
| 148 |
stdout, and the files are always extracted in binary format, just as they |
| 149 |
are stored (no conversions). |
| 150 |
.TP |
| 151 |
.B \-t |
| 152 |
test archive files. This option extracts each specified file in memory |
| 153 |
and compares the CRC (cyclic redundancy check, an enhanced checksum) of |
| 154 |
the expanded file with the original file's stored CRC value. |
| 155 |
.TP |
| 156 |
.B \-T |
| 157 |
[most OSes] set the timestamp on the archive(s) to that of the newest file |
| 158 |
in each one. This corresponds to \fIzip\fP's \fB\-go\fP option except that |
| 159 |
it can be used on wildcard zipfiles (e.g., ``\fCunzip \-T \e*.zip\fR'') and |
| 160 |
is much faster. |
| 161 |
.TP |
| 162 |
.B \-u |
| 163 |
update existing files and create new ones if needed. This option performs |
| 164 |
the same function as the \fB\-f\fP option, extracting (with query) files |
| 165 |
that are newer than those with the same name on disk, and in addition it |
| 166 |
extracts those files that do not already exist on disk. See \fB\-f\fP |
| 167 |
above for information on setting the timezone properly. |
| 168 |
.TP |
| 169 |
.B \-v |
| 170 |
list archive files (verbose format) or show diagnostic version info. |
| 171 |
This option has evolved and now behaves as both an option and a modifier. |
| 172 |
As an option it has two purposes: when a zipfile is specified with no |
| 173 |
other options, \fB\-v\fP lists archive files verbosely, adding to the |
| 174 |
basic \fB\-l\fP info the compression method, compressed size, |
| 175 |
compression ratio and 32-bit CRC. In contrast to most of the competing |
| 176 |
utilities, \fIunzip\fP removes the 12 additional header bytes of |
| 177 |
encrypted entries from the compressed size numbers. Therefore, |
| 178 |
compressed size and compression ratio figures are independent of the entry's |
| 179 |
encryption status and show the correct compression performance. (The complete |
| 180 |
size of the encrypted compressed data stream for zipfile entries is reported |
| 181 |
by the more verbose \fIzipinfo\fP(1) reports, see the separate manual.) |
| 182 |
When no zipfile is specified (that is, the complete command is simply |
| 183 |
``\fCunzip \-v\fR''), a diagnostic screen is printed. In addition to |
| 184 |
the normal header with release date and version, \fIunzip\fP lists the |
| 185 |
home Info-ZIP ftp site and where to find a list of other ftp and non-ftp |
| 186 |
sites; the target operating system for which it was compiled, as well |
| 187 |
as (possibly) the hardware on which it was compiled, the compiler and |
| 188 |
version used, and the compilation date; any special compilation options |
| 189 |
that might affect the program's operation (see also \fBDECRYPTION\fP below); |
| 190 |
and any options stored in environment variables that might do the same |
| 191 |
(see \fBENVIRONMENT OPTIONS\fP below). As a modifier it works in |
| 192 |
conjunction with other options (e.g., \fB\-t\fP) to produce more |
| 193 |
verbose or debugging output; this is not yet fully implemented |
| 194 |
but will be in future releases. |
| 195 |
.TP |
| 196 |
.B \-z |
| 197 |
display only the archive comment. |
| 198 |
.PD |
| 199 |
.\" ========================================================================= |
| 200 |
.SH MODIFIERS |
| 201 |
.TP |
| 202 |
.B \-a |
| 203 |
convert text files. Ordinarily all files are extracted exactly as they |
| 204 |
are stored (as ``binary'' files). The \fB\-a\fP option causes files identified |
| 205 |
by \fIzip\fP as text files (those with the `t' label in \fIzipinfo\fP |
| 206 |
listings, rather than `b') to be automatically extracted as such, converting |
| 207 |
line endings, end-of-file characters and the character set itself as necessary. |
| 208 |
(For example, Unix files use line feeds (LFs) for end-of-line (EOL) and |
| 209 |
have no end-of-file (EOF) marker; Macintoshes use carriage returns (CRs) |
| 210 |
for EOLs; and most PC operating systems use CR+LF for EOLs and control-Z for |
| 211 |
EOF. In addition, IBM mainframes and the Michigan Terminal System use EBCDIC |
| 212 |
rather than the more common ASCII character set, and NT supports Unicode.) |
| 213 |
Note that \fIzip\fP's identification of text files is by no means perfect; some |
| 214 |
``text'' files may actually be binary and vice versa. \fIunzip\fP therefore |
| 215 |
prints ``\fC[text]\fR'' or ``\fC[binary]\fR'' as a visual check for each file |
| 216 |
it extracts when using the \fB\-a\fP option. The \fB\-aa\fP option forces |
| 217 |
all files to be extracted as text, regardless of the supposed file type. |
| 218 |
On VMS, see also \fB\-S\fP. |
| 219 |
.TP |
| 220 |
.B \-b |
| 221 |
[general] treat all files as binary (no text conversions). This is a shortcut |
| 222 |
for \fB\-\-\-a\fP. |
| 223 |
.TP |
| 224 |
.B \-b |
| 225 |
[Tandem] force the creation files with filecode type 180 ('C') when |
| 226 |
extracting Zip entries marked as "text". (On Tandem, \fB\-a\fP is enabled |
| 227 |
by default, see above). |
| 228 |
.TP |
| 229 |
.B \-b |
| 230 |
[VMS] auto-convert binary files (see \fB\-a\fP above) to fixed-length, |
| 231 |
512-byte record format. Doubling the option (\fB\-bb\fP) forces all files |
| 232 |
to be extracted in this format. When extracting to standard output |
| 233 |
(\fB\-c\fP or \fB\-p\fP option in effect), the default conversion of text |
| 234 |
record delimiters is disabled for binary (\fB\-b\fP) resp. all (\fB\-bb\fP) |
| 235 |
files. |
| 236 |
.TP |
| 237 |
.B \-B |
| 238 |
[when compiled with UNIXBACKUP defined] save a backup copy of each |
| 239 |
overwritten file. The backup file is gets the name of the target file with |
| 240 |
a tilde and optionally a unique sequence number (up to 5 digits) appended. |
| 241 |
The sequence number is applied whenever another file with the original name |
| 242 |
plus tilde already exists. When used together with the "overwrite all" |
| 243 |
option \fB\-o\fP, numbered backup files are never created. In this case, |
| 244 |
all backup files are named as the original file with an appended tilde, |
| 245 |
existing backup files are deleted without notice. |
| 246 |
This feature works similarly to the default behavior of \fIemacs\fP(1) |
| 247 |
in many locations. |
| 248 |
.IP |
| 249 |
Example: the old copy of ``\fCfoo\fR'' is renamed to ``\fCfoo~\fR''. |
| 250 |
.IP |
| 251 |
Warning: Users should be aware that the \fB-B\fP option does not prevent |
| 252 |
loss of existing data under all circumstances. For example, when |
| 253 |
\fIunzip\fP is run in overwrite-all mode, an existing ``\fCfoo~\fR'' file |
| 254 |
is deleted before \fIunzip\fP attempts to rename ``\fCfoo\fR'' to |
| 255 |
``\fCfoo~\fR''. When this rename attempt fails (because of a file locks, |
| 256 |
insufficient privileges, or ...), the extraction of ``\fCfoo~\fR'' gets |
| 257 |
cancelled, but the old backup file is already lost. A similar scenario |
| 258 |
takes place when the sequence number range for numbered backup files gets |
| 259 |
exhausted (99999, or 65535 for 16-bit systems). In this case, the backup |
| 260 |
file with the maximum sequence number is deleted and replaced by the new |
| 261 |
backup version without notice. |
| 262 |
.TP |
| 263 |
.B \-C |
| 264 |
use case-insensitive matching for the selection of archive entries |
| 265 |
from the command-line list of extract selection patterns. |
| 266 |
\fIunzip\fP's philosophy is ``you get what you ask for'' (this is |
| 267 |
also responsible for the \fB\-L\fP/\fB\-U\fP change; see the relevant |
| 268 |
options below). Because some file systems are fully case-sensitive |
| 269 |
(notably those under the Unix operating system) and because |
| 270 |
both ZIP archives and \fIunzip\fP itself are portable across platforms, |
| 271 |
\fIunzip\fP's default behavior is to match both wildcard and literal |
| 272 |
filenames case-sensitively. That is, specifying ``\fCmakefile\fR'' |
| 273 |
on the command line will \fIonly\fP match ``makefile'' in the archive, |
| 274 |
not ``Makefile'' or ``MAKEFILE'' (and similarly for wildcard specifications). |
| 275 |
Since this does not correspond to the behavior of many other |
| 276 |
operating/file systems (for example, OS/2 HPFS, which preserves |
| 277 |
mixed case but is not sensitive to it), the \fB\-C\fP option may be |
| 278 |
used to force all filename matches to be case-insensitive. In the |
| 279 |
example above, all three files would then match ``\fCmakefile\fR'' |
| 280 |
(or ``\fCmake*\fR'', or similar). The \fB\-C\fP option affects |
| 281 |
file specs in both the normal file list and the excluded-file list (xlist). |
| 282 |
.IP |
| 283 |
Please note that the \fB\-C\fP option does neither affect the search for |
| 284 |
the zipfile(s) nor the matching of archive entries to existing files on |
| 285 |
the extraction path. On a case-sensitive file system, \fIunzip\fP will |
| 286 |
never try to overwrite a file ``FOO'' when extracting an entry ``foo''! |
| 287 |
.TP |
| 288 |
.B \-D |
| 289 |
skip restoration of timestamps for extracted items. Normally, \fIunzip\fP |
| 290 |
tries to restore all meta-information for extracted items that are supplied |
| 291 |
in the Zip archive (and do not require privileges or impose a security risk). |
| 292 |
By specifying \fB\-D\fP, \fIunzip\fP is told to suppress restoration of |
| 293 |
timestamps for directories explicitly created from Zip archive entries. |
| 294 |
This option only applies to ports that support setting timestamps for |
| 295 |
directories (currently ATheOS, BeOS, MacOS, OS/2, Unix, VMS, Win32, for other |
| 296 |
\fIunzip\fP ports, \fB\-D\fP has no effect). |
| 297 |
The duplicated option \fB\-DD\fP forces suppression of timestamp restoration |
| 298 |
for all extracted entries (files and directories). This option results in |
| 299 |
setting the timestamps for all extracted entries to the current time. |
| 300 |
.IP |
| 301 |
On VMS, the default setting for this option is \fB\-D\fP for consistency |
| 302 |
with the behaviour of BACKUP: file timestamps are restored, timestamps of |
| 303 |
extracted directories are left at the current time. To enable restoration |
| 304 |
of directory timestamps, the negated option \fB\--D\fP should be specified. |
| 305 |
On VMS, the option \fB\-D\fP disables timestamp restoration for all extracted |
| 306 |
Zip archive items. (Here, a single \fB\-D\fP on the command line combines |
| 307 |
with the default \fB\-D\fP to do what an explicit \fB\-DD\fP does on other |
| 308 |
systems.) |
| 309 |
.TP |
| 310 |
.B \-E |
| 311 |
[MacOS only] display contents of MacOS extra field during restore operation. |
| 312 |
.TP |
| 313 |
.B \-F |
| 314 |
[Acorn only] suppress removal of NFS filetype extension from stored filenames. |
| 315 |
.TP |
| 316 |
.B \-F |
| 317 |
[non-Acorn systems supporting long filenames with embedded commas, |
| 318 |
and only if compiled with ACORN_FTYPE_NFS defined] translate |
| 319 |
filetype information from ACORN RISC OS extra field blocks into a |
| 320 |
NFS filetype extension and append it to the names of the extracted files. |
| 321 |
(When the stored filename appears to already have an appended NFS filetype |
| 322 |
extension, it is replaced by the info from the extra field.) |
| 323 |
.TP |
| 324 |
.B \-i |
| 325 |
[MacOS only] ignore filenames stored in MacOS extra fields. Instead, the |
| 326 |
most compatible filename stored in the generic part of the entry's header |
| 327 |
is used. |
| 328 |
.TP |
| 329 |
.B \-j |
| 330 |
junk paths. The archive's directory structure is not recreated; all files |
| 331 |
are deposited in the extraction directory (by default, the current one). |
| 332 |
.TP |
| 333 |
.B \-J |
| 334 |
[BeOS only] junk file attributes. The file's BeOS file attributes are not |
| 335 |
restored, just the file's data. |
| 336 |
.TP |
| 337 |
.B \-J |
| 338 |
[MacOS only] ignore MacOS extra fields. All Macintosh specific info |
| 339 |
is skipped. Data-fork and resource-fork are restored as separate files. |
| 340 |
.TP |
| 341 |
.B \-K |
| 342 |
[AtheOS, BeOS, Unix only] retain SUID/SGID/Tacky file attributes. Without |
| 343 |
this flag, these attribute bits are cleared for security reasons. |
| 344 |
.TP |
| 345 |
.B \-L |
| 346 |
convert to lowercase any filename originating on an uppercase-only operating |
| 347 |
system or file system. (This was \fIunzip\fP's default behavior in releases |
| 348 |
prior to 5.11; the new default behavior is identical to the old behavior with |
| 349 |
the \fB\-U\fP option, which is now obsolete and will be removed in a future |
| 350 |
release.) Depending on the archiver, files archived under single-case |
| 351 |
file systems (VMS, old MS-DOS FAT, etc.) may be stored as all-uppercase names; |
| 352 |
this can be ugly or inconvenient when extracting to a case-preserving |
| 353 |
file system such as OS/2 HPFS or a case-sensitive one such as under |
| 354 |
Unix. By default \fIunzip\fP lists and extracts such filenames exactly as |
| 355 |
they're stored (excepting truncation, conversion of unsupported characters, |
| 356 |
etc.); this option causes the names of all files from certain systems to be |
| 357 |
converted to lowercase. The \fB\-LL\fP option forces conversion of every |
| 358 |
filename to lowercase, regardless of the originating file system. |
| 359 |
.TP |
| 360 |
.B \-M |
| 361 |
pipe all output through an internal pager similar to the Unix \fImore\fP(1) |
| 362 |
command. At the end of a screenful of output, \fIunzip\fP pauses with a |
| 363 |
``\-\-More\-\-'' prompt; the next screenful may be viewed by pressing the |
| 364 |
Enter (Return) key or the space bar. \fIunzip\fP can be terminated by |
| 365 |
pressing the ``q'' key and, on some systems, the Enter/Return key. Unlike |
| 366 |
Unix \fImore\fP(1), there is no forward-searching or editing capability. |
| 367 |
Also, \fIunzip\fP doesn't notice if long lines wrap at the edge of the screen, |
| 368 |
effectively resulting in the printing of two or more lines and the likelihood |
| 369 |
that some text will scroll off the top of the screen before being viewed. |
| 370 |
On some systems the number of available lines on the screen is not detected, |
| 371 |
in which case \fIunzip\fP assumes the height is 24 lines. |
| 372 |
.TP |
| 373 |
.B \-n |
| 374 |
never overwrite existing files. If a file already exists, skip the extraction |
| 375 |
of that file without prompting. By default \fIunzip\fP queries before |
| 376 |
extracting any file that already exists; the user may choose to overwrite |
| 377 |
only the current file, overwrite all files, skip extraction of the current |
| 378 |
file, skip extraction of all existing files, or rename the current file. |
| 379 |
.TP |
| 380 |
.B \-N |
| 381 |
[Amiga] extract file comments as Amiga filenotes. File comments are created |
| 382 |
with the \-c option of \fIzip\fP(1), or with the \-N option of the Amiga port |
| 383 |
of \fIzip\fP(1), which stores filenotes as comments. |
| 384 |
.TP |
| 385 |
.B \-o |
| 386 |
overwrite existing files without prompting. This is a dangerous option, so |
| 387 |
use it with care. (It is often used with \fB\-f\fP, however, and is the only |
| 388 |
way to overwrite directory EAs under OS/2.) |
| 389 |
.IP \fB\-P\fP\ \fIpassword\fP |
| 390 |
use \fIpassword\fP to decrypt encrypted zipfile entries (if any). \fBTHIS IS |
| 391 |
INSECURE!\fP Many multi-user operating systems provide ways for any user to |
| 392 |
see the current command line of any other user; even on stand-alone systems |
| 393 |
there is always the threat of over-the-shoulder peeking. Storing the plaintext |
| 394 |
password as part of a command line in an automated script is even worse. |
| 395 |
Whenever possible, use the non-echoing, interactive prompt to enter passwords. |
| 396 |
(And where security is truly important, use strong encryption such as Pretty |
| 397 |
Good Privacy instead of the relatively weak encryption provided by standard |
| 398 |
zipfile utilities.) |
| 399 |
.TP |
| 400 |
.B \-q |
| 401 |
perform operations quietly (\fB\-qq\fP = even quieter). Ordinarily \fIunzip\fP |
| 402 |
prints the names of the files it's extracting or testing, the extraction |
| 403 |
methods, any file or zipfile comments that may be stored in the archive, |
| 404 |
and possibly a summary when finished with each archive. The \fB\-q\fP[\fBq\fP] |
| 405 |
options suppress the printing of some or all of these messages. |
| 406 |
.TP |
| 407 |
.B \-s |
| 408 |
[OS/2, NT, MS-DOS] convert spaces in filenames to underscores. Since all PC |
| 409 |
operating systems allow spaces in filenames, \fIunzip\fP by default extracts |
| 410 |
filenames with spaces intact (e.g., ``\fCEA\ DATA.\ SF\fR''). This can be |
| 411 |
awkward, however, since MS-DOS in particular does not gracefully support |
| 412 |
spaces in filenames. Conversion of spaces to underscores can eliminate the |
| 413 |
awkwardness in some cases. |
| 414 |
.TP |
| 415 |
.B \-S |
| 416 |
[VMS] convert text files (\fB\-a\fP, \fB\-aa\fP) into Stream_LF record format, |
| 417 |
instead of the text-file default, variable-length record format. |
| 418 |
(Stream_LF is the default record format of VMS \fIunzip\fP. It is applied |
| 419 |
unless conversion (\fB\-a\fP, \fB\-aa\fP and/or \fB\-b\fP, \fB\-bb\fP) is |
| 420 |
requested or a VMS-specific entry is processed.) |
| 421 |
.TP |
| 422 |
.B \-U |
| 423 |
[UNICODE_SUPPORT only] modify or disable UTF-8 handling. |
| 424 |
When UNICODE_SUPPORT is available, the option \fB\-U\fP forces \fIunzip\fP |
| 425 |
to escape all non-ASCII characters from UTF-8 coded filenames as ``#Uxxxx'' |
| 426 |
(for UCS-2 characters, or ``#Lxxxxxx'' for unicode codepoints needing 3 |
| 427 |
octets). This option is mainly provided for debugging purpose when the |
| 428 |
fairly new UTF-8 support is suspected to mangle up extracted filenames. |
| 429 |
.IP |
| 430 |
The option \fB\-UU\fP allows to entirely disable the recognition of UTF-8 |
| 431 |
encoded filenames. The handling of filename codings within \fIunzip\fP falls |
| 432 |
back to the behaviour of previous versions. |
| 433 |
.IP |
| 434 |
[old, obsolete usage] leave filenames uppercase if |
| 435 |
created under MS-DOS, VMS, etc. See \fB\-L\fP above. |
| 436 |
.TP |
| 437 |
.B \-V |
| 438 |
retain (VMS) file version numbers. VMS files can be stored with a version |
| 439 |
number, in the format \fCfile.ext;##\fR. By default the ``\fC;##\fR'' version |
| 440 |
numbers are stripped, but this option allows them to be retained. (On |
| 441 |
file systems that limit filenames to particularly short lengths, the version |
| 442 |
numbers may be truncated or stripped regardless of this option.) |
| 443 |
.TP |
| 444 |
.B \-W |
| 445 |
[only when WILD_STOP_AT_DIR compile-time option enabled] |
| 446 |
modifies the pattern matching routine so that both `?' (single-char wildcard) |
| 447 |
and `*' (multi-char wildcard) do not match the directory separator character |
| 448 |
`/'. (The two-character sequence ``**'' acts as a multi-char wildcard that |
| 449 |
includes the directory separator in its matched characters.) Examples: |
| 450 |
.PP |
| 451 |
.EX |
| 452 |
"*.c" matches "foo.c" but not "mydir/foo.c" |
| 453 |
"**.c" matches both "foo.c" and "mydir/foo.c" |
| 454 |
"*/*.c" matches "bar/foo.c" but not "baz/bar/foo.c" |
| 455 |
"??*/*" matches "ab/foo" and "abc/foo" |
| 456 |
but not "a/foo" or "a/b/foo" |
| 457 |
.EE |
| 458 |
.IP |
| 459 |
This modified behaviour is equivalent to the pattern matching style |
| 460 |
used by the shells of some of UnZip's supported target OSs (one |
| 461 |
example is Acorn RISC OS). This option may not be available on systems |
| 462 |
where the Zip archive's internal directory separator character `/' is |
| 463 |
allowed as regular character in native operating system filenames. |
| 464 |
(Currently, UnZip uses the same pattern matching rules for both wildcard |
| 465 |
zipfile specifications and zip entry selection patterns in most ports. |
| 466 |
For systems allowing `/' as regular filename character, the -W option |
| 467 |
would not work as expected on a wildcard zipfile specification.) |
| 468 |
.TP |
| 469 |
.B \-X |
| 470 |
[VMS, Unix, OS/2, NT, Tandem] restore owner/protection info (UICs and ACL |
| 471 |
entries) under VMS, or user and group info (UID/GID) under Unix, or access |
| 472 |
control lists (ACLs) under certain network-enabled versions of OS/2 |
| 473 |
(Warp Server with IBM LAN Server/Requester 3.0 to 5.0; Warp Connect with |
| 474 |
IBM Peer 1.0), or security ACLs under Windows NT. In most cases this will |
| 475 |
require special system privileges, and doubling the option (\fB\-XX\fP) |
| 476 |
under NT instructs \fIunzip\fP to use privileges for extraction; but under |
| 477 |
Unix, for example, a user who belongs to several groups can restore files |
| 478 |
owned by any of those groups, as long as the user IDs match his or her own. |
| 479 |
Note that ordinary file attributes are always restored--this option applies |
| 480 |
only to optional, extra ownership info available on some operating systems. |
| 481 |
[NT's access control lists do not appear to be especially compatible with |
| 482 |
OS/2's, so no attempt is made at cross-platform portability of access |
| 483 |
privileges. It is not clear under what conditions this would ever be |
| 484 |
useful anyway.] |
| 485 |
.TP |
| 486 |
.B \-Y |
| 487 |
[VMS] treat archived file name endings of ``.nnn'' (where ``nnn'' is a |
| 488 |
decimal number) as if they were VMS version numbers (``;nnn''). |
| 489 |
(The default is to treat them as file types.) Example: |
| 490 |
.EX |
| 491 |
"a.b.3" -> "a.b;3". |
| 492 |
.EE |
| 493 |
.TP |
| 494 |
.B \-$ |
| 495 |
.\" Amiga support possible eventually, but not yet |
| 496 |
[MS-DOS, OS/2, NT] restore the volume label if the extraction medium is |
| 497 |
removable (e.g., a diskette). Doubling the option (\fB\-$$\fP) allows fixed |
| 498 |
media (hard disks) to be labelled as well. By default, volume labels are |
| 499 |
ignored. |
| 500 |
.IP \fB\-/\fP\ \fIextensions\fP |
| 501 |
[Acorn only] overrides the extension list supplied by Unzip$Ext environment |
| 502 |
variable. During extraction, filename extensions that match one of the items |
| 503 |
in this extension list are swapped in front of the base name of the extracted |
| 504 |
file. |
| 505 |
.TP |
| 506 |
.B \-: |
| 507 |
[all but Acorn, VM/CMS, MVS, Tandem] allows to extract archive members into |
| 508 |
locations outside of the current `` extraction root folder''. For security |
| 509 |
reasons, \fIunzip\fP normally removes ``parent dir'' path components |
| 510 |
(``../'') from the names of extracted file. This safety feature (new for |
| 511 |
version 5.50) prevents \fIunzip\fP from accidentally writing files to |
| 512 |
``sensitive'' areas outside the active extraction folder tree head. The |
| 513 |
\fB\-:\fP option lets \fIunzip\fP switch back to its previous, more liberal |
| 514 |
behaviour, to allow exact extraction of (older) archives that used ``../'' |
| 515 |
components to create multiple directory trees at the level of the current |
| 516 |
extraction folder. This option does not enable writing explicitly to the |
| 517 |
root directory (``/''). To achieve this, it is necessary to set the |
| 518 |
extraction target folder to root (e.g. \fB\-d / \fP). However, when the |
| 519 |
\fB\-:\fP option is specified, it is still possible to implicitly write to |
| 520 |
the root directory by specifying enough ``../'' path components within the |
| 521 |
zip archive. |
| 522 |
Use this option with extreme caution. |
| 523 |
.TP |
| 524 |
.B \-^ |
| 525 |
[Unix only] allow control characters in names of extracted ZIP archive |
| 526 |
entries. On Unix, a file name may contain any (8-bit) character code with |
| 527 |
the two exception '/' (directory delimiter) and NUL (0x00, the C string |
| 528 |
termination indicator), unless the specific file system has more |
| 529 |
restrictive conventions. Generally, this allows to embed ASCII control |
| 530 |
characters (or even sophisticated control sequences) in file names, at least |
| 531 |
on 'native' Unix file systems. However, it may be highly suspicious to |
| 532 |
make use of this Unix "feature". Embedded control characters in file names |
| 533 |
might have nasty side effects when displayed on screen by some listing code |
| 534 |
without sufficient filtering. And, for ordinary users, it may be difficult |
| 535 |
to handle such file names (e.g. when trying to specify it for open, copy, |
| 536 |
move, or delete operations). Therefore, \fIunzip\fP applies a filter by |
| 537 |
default that removes potentially dangerous control characters from the |
| 538 |
extracted file names. The \fB-^\fP option allows to override this filter |
| 539 |
in the rare case that embedded filename control characters are to be |
| 540 |
intentionally restored. |
| 541 |
.TP |
| 542 |
.B \-2 |
| 543 |
[VMS] force unconditionally conversion of file names to ODS2-compatible |
| 544 |
names. The default is to exploit the destination file system, preserving |
| 545 |
case and extended file name characters on an ODS5 destination file system; |
| 546 |
and applying the ODS2-compatibility file name filtering on an ODS2 destination |
| 547 |
file system. |
| 548 |
.PD |
| 549 |
.\" ========================================================================= |
| 550 |
.SH "ENVIRONMENT OPTIONS" |
| 551 |
\fIunzip\fP's default behavior may be modified via options placed in |
| 552 |
an environment variable. This can be done with any option, but it |
| 553 |
is probably most useful with the \fB\-a\fP, \fB\-L\fP, \fB\-C\fP, \fB\-q\fP, |
| 554 |
\fB\-o\fP, or \fB\-n\fP modifiers: make \fIunzip\fP auto-convert text |
| 555 |
files by default, make it convert filenames from uppercase systems to |
| 556 |
lowercase, make it match names case-insensitively, make it quieter, |
| 557 |
or make it always overwrite or never overwrite files as it extracts |
| 558 |
them. For example, to make \fIunzip\fP act as quietly as possible, only |
| 559 |
reporting errors, one would use one of the following commands: |
| 560 |
.TP |
| 561 |
Unix Bourne shell: |
| 562 |
UNZIP=\-qq; export UNZIP |
| 563 |
.TP |
| 564 |
Unix C shell: |
| 565 |
setenv UNZIP \-qq |
| 566 |
.TP |
| 567 |
OS/2 or MS-DOS: |
| 568 |
set UNZIP=\-qq |
| 569 |
.TP |
| 570 |
VMS (quotes for \fIlowercase\fP): |
| 571 |
define UNZIP_OPTS "\-qq" |
| 572 |
.PP |
| 573 |
Environment options are, in effect, considered to be just like any other |
| 574 |
command-line options, except that they are effectively the first options |
| 575 |
on the command line. To override an environment option, one may use the |
| 576 |
``minus operator'' to remove it. For instance, to override one of the |
| 577 |
quiet-flags in the example above, use the command |
| 578 |
.PP |
| 579 |
.EX |
| 580 |
unzip \-\-q[\fIother options\fP] zipfile |
| 581 |
.EE |
| 582 |
.PP |
| 583 |
The first hyphen is the normal |
| 584 |
switch character, and the second is a minus sign, acting on the q option. |
| 585 |
Thus the effect here is to cancel one quantum of quietness. To cancel |
| 586 |
both quiet flags, two (or more) minuses may be used: |
| 587 |
.PP |
| 588 |
.EX |
| 589 |
unzip \-t\-\-q zipfile |
| 590 |
unzip \-\-\-qt zipfile |
| 591 |
.EE |
| 592 |
.PP |
| 593 |
(the two are equivalent). This may seem awkward |
| 594 |
or confusing, but it is reasonably intuitive: just ignore the first |
| 595 |
hyphen and go from there. It is also consistent with the behavior of |
| 596 |
Unix \fInice\fP(1). |
| 597 |
.PP |
| 598 |
As suggested by the examples above, the default variable names are UNZIP_OPTS |
| 599 |
for VMS (where the symbol used to install \fIunzip\fP as a foreign command |
| 600 |
would otherwise be confused with the environment variable), and UNZIP |
| 601 |
for all other operating systems. For compatibility with \fIzip\fP(1), |
| 602 |
UNZIPOPT is also accepted (don't ask). If both UNZIP and UNZIPOPT |
| 603 |
are defined, however, UNZIP takes precedence. \fIunzip\fP's diagnostic |
| 604 |
option (\fB\-v\fP with no zipfile name) can be used to check the values |
| 605 |
of all four possible \fIunzip\fP and \fIzipinfo\fP environment variables. |
| 606 |
.PP |
| 607 |
The timezone variable (TZ) should be set according to the local timezone |
| 608 |
in order for the \fB\-f\fP and \fB\-u\fP to operate correctly. See the |
| 609 |
description of \fB\-f\fP above for details. This variable may also be |
| 610 |
necessary to get timestamps of extracted files to be set correctly. |
| 611 |
The WIN32 (Win9x/ME/NT4/2K/XP/2K3) port of \fIunzip\fP gets the timezone |
| 612 |
configuration from the registry, assuming it is correctly set in the |
| 613 |
Control Panel. The TZ variable is ignored for this port. |
| 614 |
.PD |
| 615 |
.\" ========================================================================= |
| 616 |
.SH DECRYPTION |
| 617 |
Encrypted archives are fully supported by Info-ZIP software, but due to |
| 618 |
United States export restrictions, de-/encryption support might be disabled |
| 619 |
in your compiled binary. However, since spring 2000, US export restrictions |
| 620 |
have been liberated, and our source archives do now include full crypt code. |
| 621 |
In case you need binary distributions with crypt support enabled, see the |
| 622 |
file ``WHERE'' in any Info-ZIP source or binary distribution for locations |
| 623 |
both inside and outside the US. |
| 624 |
.PP |
| 625 |
Some compiled versions of \fIunzip\fP may not support decryption. |
| 626 |
To check a version for crypt support, either attempt to test or extract |
| 627 |
an encrypted archive, or else check \fIunzip\fP's diagnostic |
| 628 |
screen (see the \fB\-v\fP option above) for ``\fC[decryption]\fR'' as one |
| 629 |
of the special compilation options. |
| 630 |
.PP |
| 631 |
As noted above, the \fB\-P\fP option may be used to supply a password on |
| 632 |
the command line, but at a cost in security. The preferred decryption |
| 633 |
method is simply to extract normally; if a zipfile member is encrypted, |
| 634 |
\fIunzip\fP will prompt for the password without echoing what is typed. |
| 635 |
\fIunzip\fP continues to use the same password as long as it appears to be |
| 636 |
valid, by testing a 12-byte header on each file. The correct password will |
| 637 |
always check out against the header, but there is a 1-in-256 chance that an |
| 638 |
incorrect password will as well. (This is a security feature of the PKWARE |
| 639 |
zipfile format; it helps prevent brute-force attacks that might otherwise |
| 640 |
gain a large speed advantage by testing only the header.) In the case that |
| 641 |
an incorrect password is given but it passes the header test anyway, either |
| 642 |
an incorrect CRC will be generated for the extracted data or else \fIunzip\fP |
| 643 |
will fail during the extraction because the ``decrypted'' bytes do not |
| 644 |
constitute a valid compressed data stream. |
| 645 |
.PP |
| 646 |
If the first password fails the header check on some file, \fIunzip\fP will |
| 647 |
prompt for another password, and so on until all files are extracted. If |
| 648 |
a password is not known, entering a null password (that is, just a carriage |
| 649 |
return or ``Enter'') is taken as a signal to skip all further prompting. |
| 650 |
Only unencrypted files in the archive(s) will thereafter be extracted. (In |
| 651 |
fact, that's not quite true; older versions of \fIzip\fP(1) and |
| 652 |
\fIzipcloak\fP(1) allowed null passwords, so \fIunzip\fP checks each encrypted |
| 653 |
file to see if the null password works. This may result in ``false positives'' |
| 654 |
and extraction errors, as noted above.) |
| 655 |
.PP |
| 656 |
Archives encrypted with 8-bit passwords (for example, passwords with accented |
| 657 |
European characters) may not be portable across systems and/or other |
| 658 |
archivers. This problem stems from the use of multiple encoding methods for |
| 659 |
such characters, including Latin-1 (ISO 8859-1) and OEM code page 850. |
| 660 |
DOS \fIPKZIP\fP 2.04g uses the OEM code page; Windows \fIPKZIP\fP 2.50 |
| 661 |
uses Latin-1 (and is therefore incompatible with DOS \fIPKZIP\fP); Info-ZIP |
| 662 |
uses the OEM code page on DOS, OS/2 and Win3.x ports but ISO coding |
| 663 |
(Latin-1 etc.) everywhere else; and Nico Mak's \fIWinZip\fP 6.x does not |
| 664 |
allow 8-bit passwords at all. \fIUnZip\fP 5.3 (or newer) attempts to use |
| 665 |
the default character set first (e.g., Latin-1), followed by the alternate |
| 666 |
one (e.g., OEM code page) to test passwords. On EBCDIC systems, if both |
| 667 |
of these fail, EBCDIC encoding will be tested as a last resort. (EBCDIC is |
| 668 |
not tested on non-EBCDIC systems, because there are no known archivers |
| 669 |
that encrypt using EBCDIC encoding.) ISO character encodings other than |
| 670 |
Latin-1 are not supported. The new addition of (partially) Unicode (resp. |
| 671 |
UTF-8) support in \fIUnZip\fP 6.0 has not yet been adapted to the encryption |
| 672 |
password handling in \fIunzip\fP. On systems that use UTF-8 as native |
| 673 |
character encoding, \fIunzip\fP simply tries decryption with the native |
| 674 |
UTF-8 encoded password; the built-in attempts to check the password in |
| 675 |
translated encoding have not yet been adapted for UTF-8 support and |
| 676 |
will consequently fail. |
| 677 |
.PD |
| 678 |
.\" ========================================================================= |
| 679 |
.SH EXAMPLES |
| 680 |
To use \fIunzip\fP to extract all members of the archive \fIletters.zip\fP |
| 681 |
into the current directory and subdirectories below it, creating any |
| 682 |
subdirectories as necessary: |
| 683 |
.PP |
| 684 |
.EX |
| 685 |
unzip letters |
| 686 |
.EE |
| 687 |
.PP |
| 688 |
To extract all members of \fIletters.zip\fP into the current directory only: |
| 689 |
.PP |
| 690 |
.EX |
| 691 |
unzip -j letters |
| 692 |
.EE |
| 693 |
.PP |
| 694 |
To test \fIletters.zip\fP, printing only a summary message indicating |
| 695 |
whether the archive is OK or not: |
| 696 |
.PP |
| 697 |
.EX |
| 698 |
unzip -tq letters |
| 699 |
.EE |
| 700 |
.PP |
| 701 |
To test \fIall\fP zipfiles in the current directory, printing only the |
| 702 |
summaries: |
| 703 |
.PP |
| 704 |
.EX |
| 705 |
unzip -tq \e*.zip |
| 706 |
.EE |
| 707 |
.PP |
| 708 |
(The backslash before the asterisk is only required if the shell expands |
| 709 |
wildcards, as in Unix; double quotes could have been used instead, as in |
| 710 |
the source examples below.)\ \ To extract to standard output all members of |
| 711 |
\fIletters.zip\fP whose names end in \fI.tex\fP, auto-converting to the |
| 712 |
local end-of-line convention and piping the output into \fImore\fP(1): |
| 713 |
.PP |
| 714 |
.EX |
| 715 |
unzip \-ca letters \e*.tex | more |
| 716 |
.EE |
| 717 |
.PP |
| 718 |
To extract the binary file \fIpaper1.dvi\fP to standard output and pipe it |
| 719 |
to a printing program: |
| 720 |
.PP |
| 721 |
.EX |
| 722 |
unzip \-p articles paper1.dvi | dvips |
| 723 |
.EE |
| 724 |
.PP |
| 725 |
To extract all FORTRAN and C source files--*.f, *.c, *.h, and Makefile--into |
| 726 |
the /tmp directory: |
| 727 |
.PP |
| 728 |
.EX |
| 729 |
unzip source.zip "*.[fch]" Makefile -d /tmp |
| 730 |
.EE |
| 731 |
.PP |
| 732 |
(the double quotes are necessary only in Unix and only if globbing is turned |
| 733 |
on). To extract all FORTRAN and C source files, regardless of case (e.g., |
| 734 |
both *.c and *.C, and any makefile, Makefile, MAKEFILE or similar): |
| 735 |
.PP |
| 736 |
.EX |
| 737 |
unzip \-C source.zip "*.[fch]" makefile -d /tmp |
| 738 |
.EE |
| 739 |
.PP |
| 740 |
To extract any such files but convert any uppercase MS-DOS or VMS names to |
| 741 |
lowercase and convert the line-endings of all of the files to the local |
| 742 |
standard (without respect to any files that might be marked ``binary''): |
| 743 |
.PP |
| 744 |
.EX |
| 745 |
unzip \-aaCL source.zip "*.[fch]" makefile -d /tmp |
| 746 |
.EE |
| 747 |
.PP |
| 748 |
To extract only newer versions of the files already in the current |
| 749 |
directory, without querying (NOTE: be careful of unzipping in one timezone a |
| 750 |
zipfile created in another--ZIP archives other than those created by Zip 2.1 |
| 751 |
or later contain no timezone information, and a ``newer'' file from an eastern |
| 752 |
timezone may, in fact, be older): |
| 753 |
.PP |
| 754 |
.EX |
| 755 |
unzip \-fo sources |
| 756 |
.EE |
| 757 |
.PP |
| 758 |
To extract newer versions of the files already in the current directory and |
| 759 |
to create any files not already there (same caveat as previous example): |
| 760 |
.PP |
| 761 |
.EX |
| 762 |
unzip \-uo sources |
| 763 |
.EE |
| 764 |
.PP |
| 765 |
To display a diagnostic screen showing which \fIunzip\fP and \fIzipinfo\fP |
| 766 |
options are stored in environment variables, whether decryption support was |
| 767 |
compiled in, the compiler with which \fIunzip\fP was compiled, etc.: |
| 768 |
.PP |
| 769 |
.EX |
| 770 |
unzip \-v |
| 771 |
.EE |
| 772 |
.PP |
| 773 |
In the last five examples, assume that UNZIP or UNZIP_OPTS is set to -q. |
| 774 |
To do a singly quiet listing: |
| 775 |
.PP |
| 776 |
.EX |
| 777 |
unzip \-l file.zip |
| 778 |
.EE |
| 779 |
.PP |
| 780 |
To do a doubly quiet listing: |
| 781 |
.PP |
| 782 |
.EX |
| 783 |
unzip \-ql file.zip |
| 784 |
.EE |
| 785 |
.PP |
| 786 |
(Note that the ``\fC.zip\fR'' is generally not necessary.) To do a standard |
| 787 |
listing: |
| 788 |
.PP |
| 789 |
.EX |
| 790 |
unzip \-\-ql file.zip |
| 791 |
.EE |
| 792 |
or |
| 793 |
.EX |
| 794 |
unzip \-l\-q file.zip |
| 795 |
.EE |
| 796 |
or |
| 797 |
.EX |
| 798 |
unzip \-l\-\-q file.zip |
| 799 |
.EE |
| 800 |
\fR(Extra minuses in options don't hurt.) |
| 801 |
.PD |
| 802 |
.\" ========================================================================= |
| 803 |
.SH TIPS |
| 804 |
The current maintainer, being a lazy sort, finds it very useful to define |
| 805 |
a pair of aliases: \fCtt\fR for ``\fCunzip \-tq\fR'' and \fCii\fR for |
| 806 |
``\fCunzip \-Z\fR'' (or ``\fCzipinfo\fR''). One may then simply type |
| 807 |
``\fCtt zipfile\fR'' to test an archive, something that is worth making a |
| 808 |
habit of doing. With luck \fIunzip\fP will report ``\fCNo errors detected |
| 809 |
in compressed data of zipfile.zip\fR,'' after which one may breathe a sigh |
| 810 |
of relief. |
| 811 |
.PP |
| 812 |
The maintainer also finds it useful to set the UNZIP environment variable |
| 813 |
to ``\fC\-aL\fR'' and is tempted to add ``\fC\-C\fR'' as well. His ZIPINFO |
| 814 |
variable is set to ``\fC\-z\fR''. |
| 815 |
.PD |
| 816 |
.\" ========================================================================= |
| 817 |
.SH DIAGNOSTICS |
| 818 |
The exit status (or error level) approximates the exit codes defined by PKWARE |
| 819 |
and takes on the following values, except under VMS: |
| 820 |
.RS |
| 821 |
.IP 0 |
| 822 |
normal; no errors or warnings detected. |
| 823 |
.IP 1 |
| 824 |
one or more warning errors were encountered, but processing completed |
| 825 |
successfully anyway. This includes zipfiles where one or more files |
| 826 |
was skipped due to unsupported compression method or encryption with an |
| 827 |
unknown password. |
| 828 |
.IP 2 |
| 829 |
a generic error in the zipfile format was detected. Processing may have |
| 830 |
completed successfully anyway; some broken zipfiles created by other |
| 831 |
archivers have simple work-arounds. |
| 832 |
.IP 3 |
| 833 |
a severe error in the zipfile format was detected. Processing probably |
| 834 |
failed immediately. |
| 835 |
.IP 4 |
| 836 |
\fIunzip\fP was unable to allocate memory for one or more buffers during |
| 837 |
program initialization. |
| 838 |
.IP 5 |
| 839 |
\fIunzip\fP was unable to allocate memory or unable to obtain a tty to read |
| 840 |
the decryption password(s). |
| 841 |
.IP 6 |
| 842 |
\fIunzip\fP was unable to allocate memory during decompression to disk. |
| 843 |
.IP 7 |
| 844 |
\fIunzip\fP was unable to allocate memory during in-memory decompression. |
| 845 |
.IP 8 |
| 846 |
[currently not used] |
| 847 |
.IP 9 |
| 848 |
the specified zipfiles were not found. |
| 849 |
.IP 10 |
| 850 |
invalid options were specified on the command line. |
| 851 |
.IP 11 |
| 852 |
no matching files were found. |
| 853 |
.IP 50 |
| 854 |
the disk is (or was) full during extraction. |
| 855 |
.IP 51 |
| 856 |
the end of the ZIP archive was encountered prematurely. |
| 857 |
.IP 80 |
| 858 |
the user aborted \fIunzip\fP prematurely with control-C (or similar) |
| 859 |
.IP 81 |
| 860 |
testing or extraction of one or more files failed due to unsupported |
| 861 |
compression methods or unsupported decryption. |
| 862 |
.IP 82 |
| 863 |
no files were found due to bad decryption password(s). (If even one file is |
| 864 |
successfully processed, however, the exit status is 1.) |
| 865 |
.RE |
| 866 |
.PP |
| 867 |
VMS interprets standard Unix (or PC) return values as other, scarier-looking |
| 868 |
things, so \fIunzip\fP instead maps them into VMS-style status codes. The |
| 869 |
current mapping is as follows: 1 (success) for normal exit, 0x7fff0001 |
| 870 |
for warning errors, and (0x7fff000? + 16*normal_unzip_exit_status) for all |
| 871 |
other errors, where the `?' is 2 (error) for \fIunzip\fP values 2, 9-11 and |
| 872 |
80-82, and 4 (fatal error) for the remaining ones (3-8, 50, 51). In addition, |
| 873 |
there is a compilation option to expand upon this behavior: defining |
| 874 |
RETURN_CODES results in a human-readable explanation of what the error |
| 875 |
status means. |
| 876 |
.PD |
| 877 |
.\" ========================================================================= |
| 878 |
.SH BUGS |
| 879 |
Multi-part archives are not yet supported, except in conjunction with |
| 880 |
\fIzip\fP. (All parts must be concatenated together in order, and then |
| 881 |
``\fCzip \-F\fR'' (for \fIzip 2.x\fP) or ``\fCzip \-FF\fR'' (for |
| 882 |
\fIzip 3.x\fP) must be performed on the concatenated archive in order to |
| 883 |
``fix'' it. Also, \fIzip 3.0\fP and later can combine multi-part (split) |
| 884 |
archives into a combined single-file archive using ``\fCzip \-s\- inarchive |
| 885 |
-O outarchive\fR''. See the \fIzip 3\fP manual page for more information.) |
| 886 |
This will definitely be corrected in the next major release. |
| 887 |
.PP |
| 888 |
Archives read from standard input are not yet supported, except with |
| 889 |
\fIfunzip\fP (and then only the first member of the archive can be extracted). |
| 890 |
.PP |
| 891 |
Archives encrypted with 8-bit passwords (e.g., passwords with accented |
| 892 |
European characters) may not be portable across systems and/or other |
| 893 |
archivers. See the discussion in \fBDECRYPTION\fP above. |
| 894 |
.PP |
| 895 |
\fIunzip\fP's \fB\-M\fP (``more'') option tries to take into account automatic |
| 896 |
wrapping of long lines. However, the code may fail to detect the correct |
| 897 |
wrapping locations. First, TAB characters (and similar control sequences) are |
| 898 |
not taken into account, they are handled as ordinary printable characters. |
| 899 |
Second, depending on the actual system / OS port, \fIunzip\fP may not detect |
| 900 |
the true screen geometry but rather rely on "commonly used" default dimensions. |
| 901 |
The correct handling of tabs would require the implementation of a query for |
| 902 |
the actual tabulator setup on the output console. |
| 903 |
.PP |
| 904 |
Dates, times and permissions of stored directories are not restored except |
| 905 |
under Unix. (On Windows NT and successors, timestamps are now restored.) |
| 906 |
.PP |
| 907 |
[MS-DOS] When extracting or testing files from an archive on a defective |
| 908 |
floppy diskette, if the ``Fail'' option is chosen from DOS's ``Abort, Retry, |
| 909 |
Fail?'' message, older versions of \fIunzip\fP may hang the system, requiring |
| 910 |
a reboot. This problem appears to be fixed, but control-C (or control-Break) |
| 911 |
can still be used to terminate \fIunzip\fP. |
| 912 |
.PP |
| 913 |
Under DEC Ultrix, \fIunzip\fP would sometimes fail on long zipfiles (bad CRC, |
| 914 |
not always reproducible). This was apparently due either to a hardware bug |
| 915 |
(cache memory) or an operating system bug (improper handling of page faults?). |
| 916 |
Since Ultrix has been abandoned in favor of Digital Unix (OSF/1), this may not |
| 917 |
be an issue anymore. |
| 918 |
.PP |
| 919 |
[Unix] Unix special files such as FIFO buffers (named pipes), block devices |
| 920 |
and character devices are not restored even if they are somehow represented |
| 921 |
in the zipfile, nor are hard-linked files relinked. Basically the only file |
| 922 |
types restored by \fIunzip\fP are regular files, directories and symbolic |
| 923 |
(soft) links. |
| 924 |
.PP |
| 925 |
[OS/2] Extended attributes for existing directories are only updated if the |
| 926 |
\fB\-o\fP (``overwrite all'') option is given. This is a limitation of the |
| 927 |
operating system; because directories only have a creation time associated |
| 928 |
with them, \fIunzip\fP has no way to determine whether the stored attributes |
| 929 |
are newer or older than those on disk. In practice this may mean a two-pass |
| 930 |
approach is required: first unpack the archive normally (with or without |
| 931 |
freshening/updating existing files), then overwrite just the directory entries |
| 932 |
(e.g., ``\fCunzip -o foo */\fR''). |
| 933 |
.PP |
| 934 |
[VMS] When extracting to another directory, only the \fI[.foo]\fP syntax is |
| 935 |
accepted for the \fB\-d\fP option; the simple Unix \fIfoo\fP syntax is |
| 936 |
silently ignored (as is the less common VMS \fIfoo.dir\fP syntax). |
| 937 |
.PP |
| 938 |
[VMS] When the file being extracted already exists, \fIunzip\fP's query only |
| 939 |
allows skipping, overwriting or renaming; there should additionally be a |
| 940 |
choice for creating a new version of the file. In fact, the ``overwrite'' |
| 941 |
choice does create a new version; the old version is not overwritten or |
| 942 |
deleted. |
| 943 |
.PD |
| 944 |
.\" ========================================================================= |
| 945 |
.SH "SEE ALSO" |
| 946 |
\fIfunzip\fP(1), \fIzip\fP(1), \fIzipcloak\fP(1), \fIzipgrep\fP(1), |
| 947 |
\fIzipinfo\fP(1), \fIzipnote\fP(1), \fIzipsplit\fP(1) |
| 948 |
.PD |
| 949 |
.\" ========================================================================= |
| 950 |
.SH URL |
| 951 |
The Info-ZIP home page is currently at |
| 952 |
.EX |
| 953 |
\fChttp://www.info-zip.org/pub/infozip/\fR |
| 954 |
.EE |
| 955 |
or |
| 956 |
.EX |
| 957 |
\fCftp://ftp.info-zip.org/pub/infozip/\fR . |
| 958 |
.EE |
| 959 |
.PD |
| 960 |
.\" ========================================================================= |
| 961 |
.SH AUTHORS |
| 962 |
The primary Info-ZIP authors (current semi-active members of the Zip-Bugs |
| 963 |
workgroup) are: Ed Gordon (Zip, general maintenance, shared code, Zip64, |
| 964 |
Win32, Unix, Unicode); Christian Spieler (UnZip maintenance coordination, |
| 965 |
VMS, MS-DOS, Win32, shared code, general Zip and UnZip integration and |
| 966 |
optimization); Onno van der Linden (Zip); Mike White (Win32, Windows GUI, |
| 967 |
Windows DLLs); Kai Uwe Rommel (OS/2, Win32); Steven M. Schweda (VMS, Unix, |
| 968 |
support of new features); Paul Kienitz (Amiga, Win32, Unicode); Chris |
| 969 |
Herborth (BeOS, QNX, Atari); Jonathan Hudson (SMS/QDOS); Sergio Monesi |
| 970 |
(Acorn RISC OS); Harald Denker (Atari, MVS); John Bush (Solaris, Amiga); |
| 971 |
Hunter Goatley (VMS, Info-ZIP Site maintenance); Steve Salisbury (Win32); |
| 972 |
Steve Miller (Windows CE GUI), Johnny Lee (MS-DOS, Win32, Zip64); and Dave |
| 973 |
Smith (Tandem NSK). |
| 974 |
.PP |
| 975 |
The following people were former members of the Info-ZIP development group |
| 976 |
and provided major contributions to key parts of the current code: |
| 977 |
Greg ``Cave Newt'' Roelofs (UnZip, unshrink decompression); |
| 978 |
Jean-loup Gailly (deflate compression); |
| 979 |
Mark Adler (inflate decompression, fUnZip). |
| 980 |
.PP |
| 981 |
The author of the original unzip code upon which Info-ZIP's was based |
| 982 |
is Samuel H. Smith; Carl Mascott did the first Unix port; and David P. |
| 983 |
Kirschbaum organized and led Info-ZIP in its early days with Keith Petersen |
| 984 |
hosting the original mailing list at WSMR-SimTel20. The full list of |
| 985 |
contributors to UnZip has grown quite large; please refer to the CONTRIBS |
| 986 |
file in the UnZip source distribution for a relatively complete version. |
| 987 |
.PD |
| 988 |
.\" ========================================================================= |
| 989 |
.SH VERSIONS |
| 990 |
.ta \w'vx.xxnn'u +\w'fall 1989'u+3n |
| 991 |
.PD 0 |
| 992 |
.IP "v1.2\t15 Mar 89" \w'\t\t'u |
| 993 |
Samuel H. Smith |
| 994 |
.IP "v2.0\t\ 9 Sep 89" |
| 995 |
Samuel H. Smith |
| 996 |
.IP "v2.x\tfall 1989" |
| 997 |
many Usenet contributors |
| 998 |
.IP "v3.0\t\ 1 May 90" |
| 999 |
Info-ZIP (DPK, consolidator) |
| 1000 |
.IP "v3.1\t15 Aug 90" |
| 1001 |
Info-ZIP (DPK, consolidator) |
| 1002 |
.IP "v4.0\t\ 1 Dec 90" |
| 1003 |
Info-ZIP (GRR, maintainer) |
| 1004 |
.IP "v4.1\t12 May 91" |
| 1005 |
Info-ZIP |
| 1006 |
.IP "v4.2\t20 Mar 92" |
| 1007 |
Info-ZIP (Zip-Bugs subgroup, GRR) |
| 1008 |
.IP "v5.0\t21 Aug 92" |
| 1009 |
Info-ZIP (Zip-Bugs subgroup, GRR) |
| 1010 |
.IP "v5.01\t15 Jan 93" |
| 1011 |
Info-ZIP (Zip-Bugs subgroup, GRR) |
| 1012 |
.IP "v5.1\t\ 7 Feb 94" |
| 1013 |
Info-ZIP (Zip-Bugs subgroup, GRR) |
| 1014 |
.IP "v5.11\t\ 2 Aug 94" |
| 1015 |
Info-ZIP (Zip-Bugs subgroup, GRR) |
| 1016 |
.IP "v5.12\t28 Aug 94" |
| 1017 |
Info-ZIP (Zip-Bugs subgroup, GRR) |
| 1018 |
.IP "v5.2\t30 Apr 96" |
| 1019 |
Info-ZIP (Zip-Bugs subgroup, GRR) |
| 1020 |
.IP "v5.3\t22 Apr 97" |
| 1021 |
Info-ZIP (Zip-Bugs subgroup, GRR) |
| 1022 |
.IP "v5.31\t31 May 97" |
| 1023 |
Info-ZIP (Zip-Bugs subgroup, GRR) |
| 1024 |
.IP "v5.32\t\ 3 Nov 97" |
| 1025 |
Info-ZIP (Zip-Bugs subgroup, GRR) |
| 1026 |
.IP "v5.4\t28 Nov 98" |
| 1027 |
Info-ZIP (Zip-Bugs subgroup, SPC) |
| 1028 |
.IP "v5.41\t16 Apr 00" |
| 1029 |
Info-ZIP (Zip-Bugs subgroup, SPC) |
| 1030 |
.IP "v5.42\t14 Jan 01" |
| 1031 |
Info-ZIP (Zip-Bugs subgroup, SPC) |
| 1032 |
.IP "v5.5\t17 Feb 02" |
| 1033 |
Info-ZIP (Zip-Bugs subgroup, SPC) |
| 1034 |
.IP "v5.51\t22 May 04" |
| 1035 |
Info-ZIP (Zip-Bugs subgroup, SPC) |
| 1036 |
.IP "v5.52\t28 Feb 05" |
| 1037 |
Info-ZIP (Zip-Bugs subgroup, SPC) |
| 1038 |
.IP "v6.0\t20 Apr 09" |
| 1039 |
Info-ZIP (Zip-Bugs subgroup, SPC) |
| 1040 |
.PD |