📄 unzip.doc
字号:
ters.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 Makefile--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 CInfo-ZIP 28 November 1998 (v5.4) 11UNZIP(1L) UNZIP(1L) 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 local standard (without respect to any files that might be marked ``binary''): unzip -aaCL source.zip "*.[fch]" makefile -d /tmp To extract only newer versions of the files already in the current directory, without querying (NOTE: be careful of unzipping in one timezone 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 of the files already in the cur- rent directory and to create any files not already there (same caveat as previous example): unzip -uo sources To display a diagnostic screen showing which unzip and zipinfo options are stored in environment variables, whether decryption support was compiled in, the compiler with which unzip was compiled, etc.: unzip -v In the last five examples, assume that UNZIP or UNZIP_OPTS is set to -q. To do a singly quiet listing: unzip -l file.zip To do a doubly quiet listing: unzip -ql file.zip (Note that the ``.zip'' is generally not necessary.) To do a standard listing: unzip --ql file.zip or unzip -l-q file.zip or unzip -l--q file.zip (extra minuses don't hurt)TIPS The current maintainer, being a lazy sort, finds it veryInfo-ZIP 28 November 1998 (v5.4) 12UNZIP(1L) UNZIP(1L) useful to define a pair of aliases: tt for ``unzip -tq'' and ii for ``unzip -Z'' (or ``zipinfo''). One may then simply type ``tt zipfile'' to test an archive, something that is worth making a habit of doing. With luck unzip will report ``No errors detected in compressed data of zipfile.zip,'' after which one may breathe a sigh of relief. The maintainer also finds it useful to set the UNZIP envi- ronment variable to ``-aL'' and is tempted to add ``-C'' as well. His ZIPINFO variable is set to ``-z''.DIAGNOSTICS The exit status (or error level) approximates the exit codes defined by PKWARE and takes on the following values, except under VMS: 0 normal; no errors or warnings detected. 1 one or more warning errors were encountered, but processing completed successfully any- way. This includes zipfiles where one or more files was skipped due to unsupported compression method or encryption with an unknown password. 2 a generic error in the zipfile format was detected. Processing may have completed successfully anyway; some broken zipfiles created by other archivers have simple work- arounds. 3 a severe error in the zipfile format was detected. Processing probably failed imme- diately. 4 unzip was unable to allocate memory for one or more buffers during program initializa- tion. 5 unzip was unable to allocate memory or unable to obtain a tty to read the decryp- tion password(s). 6 unzip was unable to allocate memory during decompression to disk. 7 unzip was unable to allocate memory during in-memory decompression. 8 [currently not used] 9 the specified zipfiles were not found.Info-ZIP 28 November 1998 (v5.4) 13UNZIP(1L) UNZIP(1L) 10 invalid options were specified on the com- mand line. 11 no matching files were found. 50 the disk is (or was) full during extraction. 51 the end of the ZIP archive was encountered prematurely. 80 the user aborted unzip prematurely with con- trol-C (or similar) 81 testing or extraction of one or more files failed due to unsupported compression meth- ods or unsupported decryption. 82 no files were found due to bad decryption password(s). (If even one file is success- fully processed, however, the exit status is 1.) VMS interprets standard Unix (or PC) return values as other, scarier-looking things, so unzip instead maps them into VMS-style status codes. The current mapping is as follows: 1 (success) for normal exit, 0x7fff0001 for warning errors, and (0x7fff000? + 16*nor- mal_unzip_exit_status) for all other errors, where the `?' is 2 (error) for unzip values 2, 9-11 and 80-82, and 4 (fatal error) for the remaining ones (3-8, 50, 51). In addition, there is a compilation option to expand upon this behavior: defining RETURN_CODES results in a human- readable explanation of what the error status means.BUGS Multi-part archives are not yet supported, except in con- junction with zip. (All parts must be concatenated together in order, and then ``zip -F'' must be performed on the concatenated archive in order to ``fix'' it.) This will definitely be corrected in the next major release. Archives read from standard input are not yet supported, except with funzip (and then only the first member of the archive can be extracted). Archives encrypted with 8-bit passwords (e.g., passwords with accented European characters) may not be portable across systems and/or other archivers. See the discussion in DECRYPTION above. unzip's -M (``more'') option is overly simplistic in its handling of screen output; as noted above, it fails to detect the wrapping of long lines and may thereby cause lines at the top of the screen to be scrolled off beforeInfo-ZIP 28 November 1998 (v5.4) 14UNZIP(1L) UNZIP(1L) being read. unzip should detect and treat each occurrence of line-wrap as one additional line printed. This requires knowledge of the screen's width as well as its height. In addition, unzip should detect the true screen geometry on all systems. Dates, times and permissions of stored directories are not restored except under Unix. [MS-DOS] When extracting or testing files from an archive on a defective floppy diskette, if the ``Fail'' option is chosen from DOS's ``Abort, Retry, Fail?'' message, older versions of unzip may hang the system, requiring a reboot. This problem appears to be fixed, but control-C (or con- trol-Break) can still be used to terminate unzip. Under DEC Ultrix, unzip would sometimes fail on long zip- files (bad CRC, not always reproducible). This was appar- ently due either to a hardware bug (cache memory) or an operating system bug (improper handling of page faults?). Since Ultrix has been abandoned in favor of Digital Unix (OSF/1), this may not be an issue anymore. [Unix] Unix special files such as FIFO buffers (named pipes), block devices and character devices are not restored even if they are somehow represented in the zip- file, nor are hard-linked files relinked. Basically the only file types restored by unzip are regular files, directories and symbolic (soft) links. [OS/2] Extended attributes for existing directories are only updated if the -o (``overwrite all'') option is given. This is a limitation of the operating system; because directories only have a creation time associated with them, unzip has no way to determine whether the stored attributes are newer or older than those on disk. In practice this may mean a two-pass approach is required: first unpack the archive normally (with or without fresh- ening/updating existing files), then overwrite just the directory entries (e.g., ``unzip -o foo */''). [VMS] When extracting to another directory, only the [.foo] syntax is accepted for the -d option; the simple Unix foo syntax is silently ignored (as is the less common VMS foo.dir syntax). [VMS] When the file being extracted already exists, unzip's query only allows skipping, overwriting or renam- ing; there should additionally be a choice for creating a new version of the file. In fact, the ``overwrite'' choice does create a new version; the old version is not overwritten or deleted.Info-ZIP 28 November 1998 (v5.4) 15UNZIP(1L) UNZIP(1L)SEE ALSO funzip(1L), zip(1L), zipcloak(1L), zipgrep(1L), zip- info(1L), zipnote(1L), zipsplit(1L)URL The Info-ZIP home page is currently at http://www.cdrom.com/pub/infozip/ .AUTHORS The primary Info-ZIP authors (current semi-active members of the Zip-Bugs workgroup) are: Greg ``Cave Newt'' Roelofs (UnZip); Onno van der Linden (Zip); Jean-loup Gailly (compression); Mark Adler (decompression, fUnZip); Christian Spieler (UnZip maintance coordination, VMS, MS- DOS, Windows 95, NT, shared code, general Zip and UnZip integration and optimization); Mike White (Windows GUI, Windows DLLs); Kai Uwe Rommel (OS/2); Paul Kienitz (Amiga, Windows 95); Chris Herborth (BeOS, QNX, Atari); Jonathan Hudson (SMS/QDOS); Sergio Monesi (Acorn RISC OS); Harald Denker (Atari, MVS); John Bush (Solaris, Amiga); Hunter Goatley (VMS); Steve Salisbury (Windows 95, NT); Steve Miller (Windows CE GUI), Johnny Lee (MS-DOS, Windows 95, NT); and Dave Smith (Tandem NSK). The author of the orig- inal unzip code upon which Info-ZIP's was based is Samuel H. Smith; Carl Mascott did the first Unix port; and David P. Kirschbaum organized and led Info-ZIP in its early days with Keith Petersen hosting the original mailing list at WSMR-SimTel20. The full list of contributors to UnZip has grown quite large; please refer to the CONTRIBS file in the UnZip source distribution for a relatively complete version.VERSIONS v1.2 15 Mar 89 Samuel H. Smith v2.0 9 Sep 89 Samuel H. Smith v2.x fall 1989 many Usenet contributors v3.0 1 May 90 Info-ZIP (DPK, consolidator) v3.1 15 Aug 90 Info-ZIP (DPK, consolidator) v4.0 1 Dec 90 Info-ZIP (GRR, maintainer) v4.1 12 May 91 Info-ZIP v4.2 20 Mar 92 Info-ZIP (Zip-Bugs subgroup, GRR) v5.0 21 Aug 92 Info-ZIP (Zip-Bugs subgroup, GRR) v5.01 15 Jan 93 Info-ZIP (Zip-Bugs subgroup, GRR) v5.1 7 Feb 94 Info-ZIP (Zip-Bugs subgroup, GRR) v5.11 2 Aug 94 Info-ZIP (Zip-Bugs subgroup, GRR) v5.12 28 Aug 94 Info-ZIP (Zip-Bugs subgroup, GRR) v5.2 30 Apr 96 Info-ZIP (Zip-Bugs subgroup, GRR) v5.3 22 Apr 97 Info-ZIP (Zip-Bugs subgroup, GRR) v5.31 31 May 97 Info-ZIP (Zip-Bugs subgroup, GRR) v5.32 3 Nov 97 Info-ZIP (Zip-Bugs subgroup, GRR) v5.4 28 Nov 98 Info-ZIP (Zip-Bugs subgroup, SPC)Info-ZIP 28 November 1998 (v5.4) 16
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -