with 8‐bit passwords (for example, passwords with ac‐
cented European characters) may not be portable across systems and/or
other archivers. This problem stems from the use of multiple encoding
methods for such characters, including Latin‐1 (ISO 8859‐1) and OEM code
page 850. DOS PKZIP 2.04g uses the OEM code page; Windows PKZIP 2.50
uses Latin‐1 (and is therefore incompatible with DOS PKZIP); Info‐ZIP
uses the OEM code page on DOS, OS/2 and Win3.x ports but ISO coding
(Latin‐1 etc.) everywhere else; and Nico Mak’s WinZip 6.x does not allow
8‐bit passwords at all. UnZip 5.3 (or newer) attempts to use the de‐
fault character set first (e.g., Latin‐1), followed by the alternate one
(e.g., OEM code page) to test passwords. On EBCDIC systems, if both of
these fail, EBCDIC encoding will be tested as a last resort. (EBCDIC is
not tested on non‐EBCDIC systems, because there are no known archivers
that encrypt using EBCDIC encoding.) ISO character encodings other than
Latin‐1 are not supported. The new addition of (partially) Unicode
(resp. UTF‐8) support in UnZip 6.0 has not yet been adapted to the en‐
cryption password handling in unzip. On systems that use UTF‐8 as na‐
tive character encoding, unzip simply tries decryption with the native
UTF‐8 encoded password; the built‐in attempts to check the password in
translated encoding have not yet been adapted for UTF‐8 support and will
consequently fail.
EXAMPLES
To use unzip to extract all members of the archive letters.zip into the
current directory and subdirectories below it, creating any subdirecto‐
ries as necessary:
unzip letters
To extract all members of letters.zip into the current directory only:
unzip ‐j letters
To test letters.zip, printing only a summary message indicating whether
the archive is OK or not:
unzip ‐tq letters
To test all zipfiles in the current directory, printing only the sum‐
maries:
unzip ‐tq \*.zip
(The backslash before the asterisk is only required if the shell expands
wildcards, as in Unix; double quotes could have been used instead, as in
the source examples below.) To extract to standard output all members
of letters.zip whose names end in .tex, auto‐converting to the local
end‐of‐line convention and piping the output into more(1):
unzip -ca letters \*.tex | more
To extract the binary file paper1.dvi to standard output and pipe it to
a printing program:
unzip -p articles paper1.dvi | dvips
To extract all FORTRAN and C source files‐‐*.f, *.c, *.h, and Make‐
file‐‐into the /tmp directory:
unzip source.zip "*.[fch]" Makefile ‐d /tmp
(the double quotes are necessary only in Unix and only if globbing is
turned on). To extract all FORTRAN and C source files, regardless of
case (e.g., both *.c and *.C, and any makefile, Makefile, MAKEFILE or
similar):
unzip -C source.zip "*.[fch]" makefile ‐d /tmp
To extract any such files but convert any uppercase MS‐DOS or VMS names
to lowercase and convert the line‐endings of all of the files to the lo‐
cal standard (without respect to any files that might be marked ‘‘bi‐
nary’’):
unzip -aaCL source.zip "*.[fch]" makefile ‐d /tmp
To extract only newer versions of the files already in the current di‐
rectory, without querying (NOTE: be careful of unzipping in one time‐
zone a zipfile created in another‐‐ZIP archives other than those created
by Zip 2.1 or later contain no timezone information, and a ‘‘newer’’
file from an eastern timezone may, in fact, be older):
unzip -fo sources
To extract newer versions