📄 unzip.1
字号:
.\" Info-ZIP grants permission to any individual or institution to use, copy,.\" or redistribute this software, so long as: (1) all of the original files.\" are included; (2) it is not sold for profit; and (3) this notice is re-.\" tained..\".\" unzip.1 by Greg Roelofs, Fulvio Marino, Jim van Zandt and others..\".\" =========================================================================.\" define .Y macro (for user-command examples; normal Courier font):.de Y.ft CW.in +4n.nf\&\\$1.ft.in.fi...\" =========================================================================.TH UNZIP 1L "28 Aug 94 (v5.12)".SH NAMEunzip \- list, test and extract compressed files in a ZIP archive.PD.\" =========================================================================.SH SYNOPSIS\fBunzip\fP [\fB\-Z\fP] [\fB\-cflptuvz\fP[\fBabjnoqsCLV$\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 the specified ZIP archive. A companion program, \fIzip\fP(1L), creates ZIP archives; both programs are compatible with archives created by PKWARE's \fIPKZIP\fP and \fIPKUNZIP\fP for MS-DOS, but in many cases the program options 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 Unix \fIegrep\fP(1)(regular) expressions 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 of characters within the brackets is complemented (that is, anything \fIexcept\fPthe characters inside the brackets is considered a match)..RE.IP(Be sure to quote any character which 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\fP is appended. Note that self-extracting ZIP files are supported, as with any other ZIP archive;just specify the \fC.exe\fP 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 match directory separators (`/'), this optionmay be used to exclude any files which 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 immediately after thezipfile specification, or between the \fIfile(s)\fP and the \fB\-x\fPoption. The option and directory maybe concatenated without any white space between them, but note that thismay cause normal shell behavior to be suppressed. In particular,``\fC\-d\ ~\fR'' (tilde) is expanded by Unix C shells into the name of the user's home directory, but ``\fC\-d~\fR'' is treated as aliteral 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 considered areminder of the basic \fIunzip\fP syntax rather than an exhaustive listof all possible flags..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 \-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 whichalready exist on disk and which 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 but have to do with the differences between DOS-format file times (always local time) and Unix-format times (always in GMT) and the necessity to compare thetwo. 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. In addition, the zipfile comment and individual file comments (if any) are displayed. If a file was archived from a single-case file system (for example, 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) of the expanded file with the original file's stored CRC value..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) fileswhich are newer than those with the same name on disk, and in addition itextracts those files which do not already exist on disk. See \fB\-f\fP above 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\fPlists archive files verbosely, adding to the \fB\-l\fP info the compression method, compressed size, compression ratio and 32-bit CRC. When no zipfileis specified (that is, the complete command is simply ``\fCunzip -v\fR''), adiagnostic screen is printed. In addition to the normal header with releasedate and version, \fIunzip\fP lists the home Info-ZIP ftp site and where to find a list of other ftp and non-ftp sites; the target operating system for which it was compiled, as well as (possibly) the hardware on which it was compiled, the compiler and version used, and the compilation date; any special compilation options which might affect the program's operation (see also\fBDECRYPTION\fP below); and any options stored in environment variables which might do the same (see \fBENVIRONMENT OPTIONS\fP below). As amodifier it works in conjunction with other options (e.g., \fB\-t\fP) toproduce more verbose 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 for EOF. 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 file it extracts when using the \fB\-a\fP option. The \fB\-aa\fP option forces all files to be extracted as text, regardless of the supposed file type..TP.B \-btreat all files as binary (no text conversions). This is a shortcut for\fB\-\-\-a\fP..TP.B \-Cmatch filenames case-insensitively. \fIunzip\fP's philosophy is ``you getwhat you ask for'' (this is also responsible for the \fB\-L\fP/\fB\-U\fP change; see the relevant options below). Because some filesystems are fullycase-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 literal filenamescase-sensitively. That is, specifying ``\fCmakefile\fR'' on the command linewill \fIonly\fP match ``makefile'' in the archive, not ``Makefile'' or``MAKEFILE'' (and similarly for wildcard specifications). Since this doesnot correspond to the behavior of many other operating/file systems (for example, OS/2 HPFS which preserves mixed case but is not sensitive to it),the \fB\-C\fP option may be used to force all filename matches to be case-insensitive. In the example above, all three files would then match ``\fCmakefile\fR'' (or ``\fCmake*\fR'', or similar). The \fB\-C\fP optionaffects files in both the normal file list and the excluded-file list (xlist)..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 \-Lconvert to lowercase any filename originating on an uppercase-only operating system or filesystem. (This was \fIunzip\fP's default behavior in releases prior to 5.11; the new default behavior is identical to the old behavior with the \fB\-U\fP option, which is now obsolete and will be removed in a future release.) Depending on the archiver, files archived under single-case filesystems (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 filesystem such as OS/2 HPFS or a case-sensitive one such as underUnix. By default \fIunzip\fP 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..TP.B \-nnever overwrite existing files. If a file already exists, skip the extractionof that file without prompting. By default \fIunzip\fP queries beforeextracting any file which already exists; the user may choose to overwriteonly the current file, overwrite all files, skip extraction of the currentfile, skip extraction of all existing files, or rename the current file..TP.B \-ooverwrite existing files without prompting. This is a dangerous option, souse it with care. (It is often used with \fB\-f\fP, however.).TP.B \-qperform operations quietly (\fB\-qq\fP = even quieter). Ordinarily \fIunzip\fPprints the names of the files it's extracting or testing, the extractionmethods, any file or zipfile comments which may be stored in the archive,and possibly a summary when finished with each archive. The \fB\-q\fP[\fBq\fP]options suppress the printing of some or all of these messages..TP.B \-s[OS/2, NT, MS-DOS] convert spaces in filenames to underscores. Since all PCoperating systems allow spaces in filenames, \fIunzip\fP by default extracts filenames with spaces intact (e.g., ``\fCEA\ DATA.\ SF\fR''). This can beawkward, however, since MS-DOS in particular does not gracefully support spaces in filenames. Conversion of spaces to underscores can eliminate the awkwardness in some cases..TP.B \-U(obsolete; to be removed in a future release) leave filenames uppercase if created under MS-DOS, VMS, etc. See \fB\-L\fP above..TP.B \-Vretain (VMS) file version numbers. VMS files can be stored with a versionnumber, in the format \fCfile.ext;##\fP. By default the ``\fC;##\fR'' version numbers are stripped, but this option allows them to be retained. (On filesystems which limit filenames to particularly short lengths, the version numbers may be truncated or stripped regardless of this option.).TP.B \-X[VMS] restore owner/protection info (may require system privileges). Ordinaryfile attributes are always restored, but this option allows UICs to be restoredas well. [The next version of \fIunzip\fP will support Unix UID/GID info as well, and possibly NT permissions.].TP.B \-$[MS-DOS, OS/2, NT, Amiga] restore the volume label if the extraction medium isremovable (e.g., a diskette). Doubling the option (\fB\-$$\fP) allows fixedmedia (hard disks) to be labelled as well. By default, volume labels areignored..PD.\" =========================================================================.SH ENVIRONMENT OPTIONS\fIunzip\fP's default behavior may be modified via options placed inan environment variable. This can be done with any option, but itis probably most useful with the \fB\-a\fP, \fB\-L\fP, \fB\-C\fP, \fB\-q\fP, \fB\-o\fP, or \fB\-n\fP modifiers: make \fIunzip\fP 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 overwrite or never overwrite files as it extractsthem. For example, to make \fIunzip\fP act as quietly as possible, onlyreporting errors, one would use one of the following commands:.LP.DT.ft CW.in +4n.ta \w'UNZIP=\-qq; export UNZIP'u+4n.in.ft.PD 0.Y "UNZIP=\-qq; export UNZIP\t\fRUnix Bourne shell".Y "setenv UNZIP \-qq\t\fRUnix C shell".Y "set UNZIP=\-qq\t\fROS/2 or MS-DOS".Y "define UNZIP_OPTS ""\-qq""\t\fRVMS (quotes for \fIlowercase\fP)".PD.LPEnvironment options are, in effect, considered to be just like any othercommand-line options, except that they are effectively the first optionson 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.LP.Y "unzip \-\-q[\fIother options\fC] zipfile".LP
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -