📄 unzip.1
字号:
.\" Copyright (c) 1990-2005 Info-ZIP. All rights reserved..\".\" See the accompanying file LICENSE, version 2000-Apr-09 or later.\" (the contents of which are also included in unzip.h) for terms of use..\" If, for some reason, all these files are missing, the Info-ZIP license.\" also may be found at: ftp://ftp.info-zip.org/pub/infozip/license.html.\".\" unzip.1 by Greg Roelofs, Fulvio Marino, Jim van Zandt and others..\".\" =========================================================================.\" define .EX/.EE (for multiline user-command examples; normal Courier font).de EX.in +4n.nf.ft CW...de EE.ft R.fi.in -4n...\" =========================================================================.TH UNZIP 1L "28 February 2005 (v5.52)" "Info-ZIP".SH NAMEunzip \- list, test and extract compressed files in a ZIP archive.PD.SH SYNOPSIS\fBunzip\fP [\fB\-Z\fP] [\fB\-cflptTuvz\fP[\fBabjnoqsCKLMVWX$/:\fP]]\fIfile\fP[\fI.zip\fP] [\fIfile(s)\fP\ .\|.\|.][\fB\-x\fP\ \fIxfile(s)\fP\ .\|.\|.] [\fB\-d\fP\ \fIexdir\fP].PD.\" =========================================================================.SH DESCRIPTION\fIunzip\fP will list, test, or extract files from a ZIP archive, commonlyfound on MS-DOS systems. The default behavior (with no options) is to extractinto the current directory (and subdirectories below it) all files from thespecified ZIP archive. A companion program, \fIzip\fP(1L), creates ZIParchives; both programs are compatible with archives created by PKWARE's\fIPKZIP\fP and \fIPKUNZIP\fP for MS-DOS, but in many cases the programoptions or default behaviors differ..PD.\" =========================================================================.SH ARGUMENTS.TP.IR file [ .zip ]Path of the ZIP archive(s). If the file specification is a wildcard,each matching file is processed in an order determined by the operatingsystem (or file system). Only the filename can be a wildcard; the pathitself cannot. Wildcard expressions are similar to those supported incommonly used Unix shells (\fIsh\fP, \fIksh\fP, \fIcsh\fP) and may contain:.RS.IP *matches a sequence of 0 or more characters.IP ?matches exactly 1 character.IP [.\|.\|.]matches any single character found inside the brackets; ranges are specifiedby a beginning character, a hyphen, and an ending character. If an exclamationpoint or a caret (`!' or `^') follows the left bracket, then the range ofcharacters within the brackets is complemented (that is, anything \fIexcept\fPthe characters inside the brackets is considered a match). To specify averbatim left bracket, the three-character sequence ``[[]'' has to be used..RE.IP(Be sure to quote any character that might otherwise be interpreted ormodified by the operating system, particularly under Unix and VMS.) If nomatches are found, the specification is assumed to be a literal filename;and if that also fails, the suffix \fC.zip\fR is appended. Note thatself-extracting ZIP files are supported, as with any other ZIP archive;just specify the \fC.exe\fR suffix (if any) explicitly..IP [\fIfile(s)\fP]An optional list of archive members to be processed, separated by spaces.(VMS versions compiled with VMSCLI defined must delimit files with commasinstead. See \fB\-v\fP in \fBOPTIONS\fP below.)Regular expressions (wildcards) may be used to match multiple members; seeabove. Again, be sure to quote expressions that would otherwise be expandedor modified by the operating system..IP [\fB\-x\fP\ \fIxfile(s)\fP]An optional list of archive members to be excluded from processing.Since wildcard characters normally match (`/') directory separators(for exeptions see the option \fb\-W\fp\), this option may be usedto exclude any files that are in subdirectories. Forexample, ``\fCunzip foo *.[ch] -x */*\fR'' would extract all C source filesin the main directory, but none in any subdirectories. Without the \fB\-x\fPoption, all C source files in all directories within the zipfile would beextracted..IP [\fB\-d\fP\ \fIexdir\fP]An optional directory to which to extract files. By default, all filesand subdirectories are recreated in the current directory; the \fB\-d\fPoption allows extraction in an arbitrary directory (always assuming onehas permission to write to the directory). This option need not appearat the end of the command line; it is also accepted before the zipfilespecification (with the normal options), immediately after the zipfilespecification, or between the \fIfile(s)\fP and the \fB\-x\fP option.The option and directory may be concatenated without any white spacebetween them, but note that this may cause normal shell behavior to besuppressed. In particular, ``\fC\-d\ ~\fR'' (tilde) is expanded by UnixC shells into the name of the user's home directory, but ``\fC\-d~\fR''is treated as a literal subdirectory ``\fB~\fP'' of the current directory..\" =========================================================================.SH OPTIONSNote that, in order to support obsolescent hardware, \fIunzip\fP's usagescreen is limited to 22 or 23 lines and should therefore be consideredonly a reminder of the basic \fIunzip\fP syntax rather than an exhaustivelist of all possible flags. The exhaustive list follows:.TP.B \-Z\fIzipinfo\fP(1L) mode. If the first option on the command line is \fB\-Z\fP,the remaining options are taken to be \fIzipinfo\fP(1L) options. See theappropriate manual page for a description of these options..TP.B \-A[OS/2, Unix DLL] print extended help for the DLL's programming interface (API)..TP.B \-cextract files to stdout/screen (``CRT''). This option is similar to the\fB\-p\fP option except that the name of each file is printed as it isextracted, the \fB\-a\fP option is allowed, and ASCII-EBCDIC conversionis automatically performed if appropriate. This option is not listed inthe \fIunzip\fP usage screen..TP.B \-ffreshen existing files, i.e., extract only those files thatalready exist on disk and that are newer than the disk copies. Bydefault \fIunzip\fP queries before overwriting, but the \fB\-o\fP optionmay be used to suppress the queries. Note that under many operating systems,the TZ (timezone) environment variable must be set correctly in order for\fB\-f\fP and \fB\-u\fP to work properly (under Unix the variable is usuallyset automatically). The reasons for this are somewhat subtle buthave to do with the differences between DOS-format file times (always localtime) and Unix-format times (always in GMT/UTC) and the necessity to comparethe two. A typical TZ value is ``PST8PDT'' (US Pacific time with automaticadjustment for Daylight Savings Time or ``summer time'')..TP.B \-llist archive files (short format). The names, uncompressed file sizes andmodification dates and times of the specified files are printed, alongwith totals for all files specified. If UnZip was compiled with OS2_EASdefined, the \fB\-l\fP option also lists columns for the sizes of storedOS/2 extended attributes (EAs) and OS/2 access control lists (ACLs). Inaddition, the zipfile comment and individual file comments (if any) aredisplayed. If a file was archived from a single-case file system (forexample, the old MS-DOS FAT file system) and the \fB\-L\fP option was given,the filename is converted to lowercase and is prefixed with a caret (^)..TP.B \-pextract files to pipe (stdout). Nothing but the file data is sent tostdout, and the files are always extracted in binary format, just as theyare stored (no conversions)..TP.B \-ttest archive files. This option extracts each specified file in memoryand compares the CRC (cyclic redundancy check, an enhanced checksum) ofthe expanded file with the original file's stored CRC value..TP.B \-T[most OSes] set the timestamp on the archive(s) to that of the newest filein each one. This corresponds to \fIzip\fP's \fB\-go\fP option except thatit can be used on wildcard zipfiles (e.g., ``\fCunzip \-T \e*.zip\fR'') andis much faster..TP.B \-uupdate existing files and create new ones if needed. This option performsthe same function as the \fB\-f\fP option, extracting (with query) filesthat are newer than those with the same name on disk, and in addition itextracts those files that do not already exist on disk. See \fB\-f\fPabove for information on setting the timezone properly..TP.B \-vbe verbose or print diagnostic version info. This option has evolved andnow behaves as both an option and a modifier. As an option it has twopurposes: when a zipfile is specified with no other options, \fB\-v\fP listsarchive files verbosely, adding to the basic \fB\-l\fP info the compressionmethod, compressed size, compression ratio and 32-bit CRC. In contrast tomost of the competing utilities, \fIunzip\fP removes the 12 additional headerbytes of encrypted entries from the compressed size numbers. Therefore,compressed size and compression ratio figures are independent of the entry'sencryption status and show the correct compression performance. (The completesize of the encryped compressed data stream for zipfile entries is reportedby the more verbose \fIzipinfo\fP(1L) reports, see the separate manual.)When no zipfile is specified (that is, the complete command is simply``\fCunzip \-v\fR''), a diagnostic screen is printed. In addition tothe normal header with release date and version, \fIunzip\fP lists thehome Info-ZIP ftp site and where to find a list of other ftp and non-ftpsites; the target operating system for which it was compiled, as wellas (possibly) the hardware on which it was compiled, the compiler andversion used, and the compilation date; any special compilation optionsthat might affect the program's operation (see also \fBDECRYPTION\fP below);and any options stored in environment variables that might do the same(see \fBENVIRONMENT OPTIONS\fP below). As a modifier it works inconjunction with other options (e.g., \fB\-t\fP) to produce moreverbose or debugging output; this is not yet fully implementedbut will be in future releases..TP.B \-zdisplay only the archive comment..PD.\" =========================================================================.SH MODIFIERS.TP.B \-aconvert text files. Ordinarily all files are extracted exactly as theyare stored (as ``binary'' files). The \fB\-a\fP option causes files identifiedby \fIzip\fP as text files (those with the `t' label in \fIzipinfo\fPlistings, rather than `b') to be automatically extracted as such, convertingline endings, end-of-file characters and the character set itself as necessary.(For example, Unix files use line feeds (LFs) for end-of-line (EOL) andhave no end-of-file (EOF) marker; Macintoshes use carriage returns (CRs)for EOLs; and most PC operating systems use CR+LF for EOLs and control-Z forEOF. In addition, IBM mainframes and the Michigan Terminal System use EBCDICrather than the more common ASCII character set, and NT supports Unicode.)Note that \fIzip\fP's identification of text files is by no means perfect; some``text'' files may actually be binary and vice versa. \fIunzip\fP thereforeprints ``\fC[text]\fR'' or ``\fC[binary]\fR'' as a visual check for each fileit extracts when using the \fB\-a\fP option. The \fB\-aa\fP option forcesall files to be extracted as text, regardless of the supposed file type..TP.B \-b[general] treat all files as binary (no text conversions). This is a shortcutfor \fB\-\-\-a\fP..TP.B \-b[Tandem] force the creation files with filecode type 180 ('C') whenextracting Zip entries marked as "text". (On Tandem, \fB\-a\fP is enabledby default, see above)..TP.B \-b[VMS] auto-convert binary files (see \fB\-a\fP above) to fixed-length,512-byte record format. Doubling the option (\fB\-bb\fP) forces all filesto be extracted in this format. When extracting to standard output(\fB\-c\fP or \fB\-p\fP option in effect), the default conversion of textrecord delimiters is disabled for binary (\fB\-b\fP) resp. all (\fB\-bb\fP)files..TP.B \-B[Unix only, and only if compiled with UNIXBACKUP defined] save a backup copyof each overwritten file with a tilde appended (e.g., the old copy of``\fCfoo\fR'' is renamed to ``\fCfoo~\fR''). This is similar to the defaultbehavior of \fIemacs\fP(1) in many locations..TP.B \-Cuse case-insensitive matching for the selection of archive entriesfrom the command-line list of extract selection patterns.\fIunzip\fP's philosophy is ``you get what you ask for'' (this isalso responsible for the \fB\-L\fP/\fB\-U\fP change; see the relevantoptions below). Because some file systems are fully case-sensitive(notably those under the Unix operating system) and becauseboth ZIP archives and \fIunzip\fP itself are portable across platforms,\fIunzip\fP's default behavior is to match both wildcard and literalfilenames case-sensitively. That is, specifying ``\fCmakefile\fR''on the command line will \fIonly\fP match ``makefile'' in the archive,not ``Makefile'' or ``MAKEFILE'' (and similarly for wildcard specifications).Since this does not correspond to the behavior of many otheroperating/file systems (for example, OS/2 HPFS, which preservesmixed case but is not sensitive to it), the \fB\-C\fP option may beused to force all filename matches to be case-insensitive. In theexample above, all three files would then match ``\fCmakefile\fR''(or ``\fCmake*\fR'', or similar). The \fB\-C\fP option affectsfile specs in both the normal file list and the excluded-file list (xlist)..IPPlease note that the \fB\-L\fP option does neither affect the search forthe zipfile(s) nor the matching of archive entries to existing files onthe extraction path. On a case-sensitive file system, \fIunzip\fP willnever try to overwrite a file ``FOO'' when extracting an entry ``foo''!.TP.B \-E[MacOS only] display contents of MacOS extra field during restore operation..TP.B \-F[Acorn only] suppress removal of NFS filetype extension from stored filenames..TP.B \-F[non-Acorn systems supporting long filenames with embedded commas,and only if compiled with ACORN_FTYPE_NFS defined] translatefiletype information from ACORN RISC OS extra field blocks into aNFS filetype extension and append it to the names of the extracted files.(When the stored filename appears to already have an appended NFS filetypeextension, it is replaced by the info from the extra field.).TP.B \-i[MacOS only] ignore filenames stored in MacOS extra fields. Instead, themost compatible filename stored in the generic part of the entry's headeris used..TP.B \-jjunk paths. The archive's directory structure is not recreated; all filesare deposited in the extraction directory (by default, the current one)..TP.B \-J[BeOS only] junk file attributes. The file's BeOS file attributes are notrestored, just the file's data..TP.B \-J[MacOS only] ignore MacOS extra fields. All Macintosh specific infois skipped. Data-fork and resource-fork are restored as separate files..TP.B \-K[AtheOS, BeOS, Unix only] retain SUID/SGID/Tacky file attributes. Withoutthis flag, these attribute bits are cleared for security reasons..TP.B \-Lconvert to lowercase any filename originating on an uppercase-only operatingsystem or file system. (This was \fIunzip\fP's default behavior in releasesprior to 5.11; the new default behavior is identical to the old behavior withthe \fB\-U\fP option, which is now obsolete and will be removed in a futurerelease.) Depending on the archiver, files archived under single-casefile 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-preservingfile system such as OS/2 HPFS or a case-sensitive one such as underUnix. By default \fIunzip\fP lists and extracts such filenames exactly asthey're stored (excepting truncation, conversion of unsupported characters,
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -