📄 unzip.doc
字号:
data. -J [MacOS only] ignore MacOS extra fields. All Macin- tosh specific info is skipped. Data-fork and resource-fork are restored as separate files. -L convert to lowercase any filename originating on an uppercase-only operating system or file system. (This was unzip's default behavior in releases prior to 5.11; the new default behavior is identi- cal to the old behavior with the -U option, which is now obsolete and will be removed in a future release.) Depending on the archiver, files archived under single-case file systems (VMS, old MS-DOS FAT, etc.) may be stored as all-uppercase names; this can be ugly or inconvenient when extracting to a case-preserving file system such as OS/2 HPFS or a case-sensitive one such as under Unix. By default unzip lists and extracts such filenames exactly as they're stored (excepting truncation, conversion of unsupported characters, etc.); this option causes the names of all files from certain systems to be converted to lowercase. -M pipe all output through an internal pager similar to the Unixmore(1) command. At the end of a screenful of output, unzip pauses with a ``--More--'' prompt; the next screenful may be viewed by pressing the Enter (Return) key or the space bar. unzip can be terminated by pressing the ``q'' key and, on some systems, the Enter/Return key. Unlike Unix more(1), there is no forward- searching or editing capability. Also, unzip doesn't notice if long lines wrap at the edge of the screen, effectively resulting in the printing of two or more lines and the likelihood that some text will scroll off the top of the screen beforeInfo-ZIP 28 November 1998 (v5.4) 6UNZIP(1L) UNZIP(1L) being viewed. On some systems the number of avail- able lines on the screen is not detected, in which case unzip assumes the height is 24 lines. -n never overwrite existing files. If a file already exists, skip the extraction of that file without prompting. By default unzip queries before extracting any file that already exists; the user may choose to overwrite only the current file, overwrite all files, skip extraction of the current file, skip extraction of all existing files, or rename the current file. -N [Amiga] extract file comments as Amiga filenotes. File comments are created with the -c option of zip(1L), or with the -N option of the Amiga port of zip(1L), which stores filenotes as comments. -o overwrite existing files without prompting. This is a dangerous option, so use it with care. (It is often used with -f, however, and is the only way to overwrite directory EAs under OS/2.) -P password use password to decrypt encrypted zipfile entries (if any). THIS IS INSECURE! Many multi-user oper- ating systems provide ways for any user to see the current command line of any other user; even on stand-alone systems there is always the threat of over-the-shoulder peeking. Storing the plaintext password as part of a command line in an automated script is even worse. Whenever possible, use the non-echoing, interactive prompt to enter passwords. (And where security is truly important, use strong encryption such as Pretty Good Privacy instead of the relatively weak encryption provided by standard zipfile utilities.) -q perform operations quietly (-qq = even quieter). Ordinarily unzip prints the names of the files it's extracting or testing, the extraction methods, any file or zipfile comments that may be stored in the archive, and possibly a summary when finished with each archive. The -q[q] options suppress the printing of some or all of these messages. -s [OS/2, NT, MS-DOS] convert spaces in filenames to underscores. Since all PC operating systems allow spaces in filenames, unzip by default extracts filenames with spaces intact (e.g., ``EA DATA. SF''). This can be awkward, however, since MS-DOS in particular does not gracefully sup- port spaces in filenames. Conversion of spaces toInfo-ZIP 28 November 1998 (v5.4) 7UNZIP(1L) UNZIP(1L) underscores can eliminate the awkwardness in some cases. -U (obsolete; to be removed in a future release) leave filenames uppercase if created under MS-DOS, VMS, etc. See -L above. -V retain (VMS) file version numbers. VMS files can be stored with a version number, in the format file.ext;##. By default the ``;##'' version num- bers are stripped, but this option allows them to be retained. (On file systems that limit filenames to particularly short lengths, the version numbers may be truncated or stripped regardless of this option.) -X [VMS, Unix, OS/2, NT] restore owner/protection info (UICs) under VMS, or user and group info (UID/GID) under Unix, or access control lists (ACLs) under certain network-enabled versions of OS/2 (Warp Server with IBM LAN Server/Requester 3.0 to 5.0; Warp Connect with IBM Peer 1.0), or security ACLs under Windows NT. In most cases this will require special system privileges, and doubling the option (-XX) under NT instructs unzip to use privileges for extraction; but under Unix, for example, a user who belongs to several groups can restore files owned by any of those groups, as long as the user IDs match his or her own. Note that ordinary file attributes are always restored--this option applies only to optional, extra ownership info available on some operating systems. [NT's access control lists do not appear to be especially compatible with OS/2's, so no attempt is made at cross-platform portability of access privileges. It is not clear under what conditions this would ever be useful anyway.] -$ [MS-DOS, OS/2, NT] restore the volume label if the extraction medium is removable (e.g., a diskette). Doubling the option (-$$) allows fixed media (hard disks) to be labelled as well. By default, volume labels are ignored.ENVIRONMENT OPTIONS unzip's default behavior may be modified via options placed in an environment variable. This can be done with any option, but it is probably most useful with the -a, -L, -C, -q, -o, or -n modifiers: make unzip auto-convert text files by default, make it convert filenames from uppercase systems to lowercase, make it match names case- insensitively, make it quieter, or make it always over- write or never overwrite files as it extracts them. For example, to make unzip act as quietly as possible, onlyInfo-ZIP 28 November 1998 (v5.4) 8UNZIP(1L) UNZIP(1L) reporting errors, one would use one of the following com- mands: UNZIP=-qq; export UNZIP Unix Bourne shell setenv UNZIP -qq Unix C shell set UNZIP=-qq OS/2 or MS-DOS define UNZIP_OPTS "-qq" VMS (quotes for lowercase) Environment options are, in effect, considered to be just like any other command-line options, except that they are effectively the first options on the command line. To override an environment option, one may use the ``minus operator'' to remove it. For instance, to override one of the quiet-flags in the example above, use the command unzip --q[other options] zipfile The first hyphen is the normal switch character, and the second is a minus sign, acting on the q option. Thus the effect here is to cancel one quantum of quietness. To cancel both quiet flags, two (or more) minuses may be used: unzip -t--q zipfile unzip ---qt zipfile (the two are equivalent). This may seem awkward or con- fusing, but it is reasonably intuitive: just ignore the first hyphen and go from there. It is also consistent with the behavior of Unix nice(1). As suggested by the examples above, the default variable names are UNZIP_OPTS for VMS (where the symbol used to install unzip as a foreign command would otherwise be con- fused with the environment variable), and UNZIP for all other operating systems. For compatibility with zip(1L), UNZIPOPT is also accepted (don't ask). If both UNZIP and UNZIPOPT are defined, however, UNZIP takes precedence. unzip's diagnostic option (-v with no zipfile name) can be used to check the values of all four possible unzip and zipinfo environment variables. The timezone variable (TZ) should be set according to the local timezone in order for the -f and -u to operate cor- rectly. See the description of -f above for details. This variable may also be necessary in order for times- tamps on extracted files to be set correctly. Under Win- dows 95/NT unzip should know the correct timezone even if TZ is unset, assuming the timezone is correctly set in the Control Panel.DECRYPTION Encrypted archives are fully supported by Info-ZIP soft- ware, but due to United States export restrictions, theInfo-ZIP 28 November 1998 (v5.4) 9UNZIP(1L) UNZIP(1L) encryption and decryption sources are not packaged with the regular unzip and zip distributions. Since the crypt sources were written by Europeans, however, they are freely available at sites throughout the world; see the file ``WHERE'' in any Info-ZIP source or binary distribu- tion for locations both inside and outside the US. Because of the separate distribution, not all compiled versions of unzip support decryption. To check a version for crypt support, either attempt to test or extract an encrypted archive, or else check unzip's diagnostic screen (see the -v option above) for ``[decryption]'' as one of the special compilation options. As noted above, the -P option may be used to supply a password on the command line, but at a cost in security. The preferred decryption method is simply to extract nor- mally; if a zipfile member is encrypted, unzip will prompt for the password without echoing what is typed. unzip continues to use the same password as long as it appears to be valid, by testing a 12-byte header on each file. The correct password will always check out against the header, but there is a 1-in-256 chance that an incorrect password will as well. (This is a security feature of the PKWARE zipfile format; it helps prevent brute-force attacks that might otherwise gain a large speed advantage by testing only the header.) In the case that an incor- rect password is given but it passes the header test any- way, either an incorrect CRC will be generated for the extracted data or else unzip will fail during the extrac- tion because the ``decrypted'' bytes do not constitute a valid compressed data stream. If the first password fails the header check on some file, unzip will prompt for another password, and so on until all files are extracted. If a password is not known, entering a null password (that is, just a carriage return or ``Enter'') is taken as a signal to skip all further prompting. Only unencrypted files in the archive(s) will thereafter be extracted. (In fact, that's not quite true; older versions of zip(1L) and zipcloak(1L) allowed null passwords, so unzip checks each encrypted file to see if the null password works. This may result in ``false posi- tives'' and extraction errors, as noted above.) Archives encrypted with 8-bit passwords (for example, passwords with accented 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 Latin-1 everywhereInfo-ZIP 28 November 1998 (v5.4) 10UNZIP(1L) UNZIP(1L) else; and Nico Mak's WinZip 6.x does not allow 8-bit pass- words at all. UnZip 5.3 attempts to use the default char- acter 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. (Since there are no known archivers that encrypt using EBCDIC encoding, EBCDIC is not tested on non-EBCDIC systems.) ISO character encod- ings other than Latin-1 are not supported.EXAMPLES To use unzip to extract all members of the archive let- ters.zip into the current directory and subdirectories below it, creating any subdirectories 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 indi- cating whether the archive is OK or not: unzip -tq letters To test all zipfiles in the current directory, printing only the summaries: 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 let-
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -