📄 unzip.doc
字号:
UNZIP(1L) LOCAL USER COMMANDS UNZIP(1L)NAME unzip - list, test and extract compressed files in a ZIP archiveSYNOPSIS unzip [-Z] [-cflptuvz[ajnoqsUV$]] file[.zip] [file(s) ...] [-x xfile(s) ...] [-d exdir]DESCRIPTION unzip will list, test, or extract files from a ZIP archive, commonly found on MS-DOS systems. The default behavior (with no options) is to extract into the current directory (and subdirectories below it) all files from the specified ZIP archive. A companion program, zip(1L), creates ZIP archives; both programs are compatible with PKWARE's PKZIP and PKUNZIP for MS-DOS.ARGUMENTS 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 operating system (or file sys- tem). Only the filename can be a wildcard; the path itself cannot. Wildcard expressions are similar to Unix egrep(1) (regular) expressions and may contain: * matches a sequence of 0 or more characters ? matches exactly 1 character [...] matches any single character found inside the brackets; ranges are specified by a beginning character, a hyphen, and an ending character. If an exclamation point or a caret (`!' or `^') fol- lows the left bracket, then the range of charac- ters within the brackets is complemented (that is, anything except the characters inside the brackets is considered a match). (Be sure to quote any character which might otherwise be interpreted or modified by the operating system, particularly under Unix and VMS.) If no matches are found, the specification is assumed to be a literal filename; and if that also fails, the suffix .zip is appended. Note that self-extracting ZIP files are sup- ported; just specify the .exe suffix (if any) expli- citly. [file(s)] An optional list of archive members to be processed. Regular expressions (wildcards) may be used to match multiple members; see above. Again, be sure to quote expressions that would otherwise be expanded or modi- fied by the operating system. [-x xfile(s)] An optional list of archive members to be excluded from processing. Since wildcard characters match directory separators (`/'), this option may be used to exclude any files which are in subdirectories. For example, ``unzip foo *.[ch] -x */*'' would extract all C source files in the main directory, but none in any subdirec- tories. Without the -x option, all C source files in all directories within the zipfile would be extracted. [-d exdir] An optional directory to which to extract files. By default, all files and subdirectories are recreated in the current directory; the -d option allows extraction in an arbitrary directory (always assuming one has per- mission to write to the directory). This option need not appear at the end of the command line; it is also accepted immediately after the zipfile specification, or between the file(s) and the -x option.OPTIONS -Z zipinfo(1) mode. If the first option on the command line is -Z, the remaining options are taken to be zipinfo(1) options. See the appropriate manual page for a description of these options. -c extract files to stdout/screen (``CRT''). This option is similar to the -p option except that the name of each file is printed as it is extracted, the -a option is allowed, and ASCII-EBCDIC conversion is automati- cally performed if appropriate. -f freshen existing files, i.e., extract only those files which already exist on disk and which are newer than the disk copies. By default unzip queries before overwriting, but the -o option may be used to suppress the queries. -l list archive files (short format). The name, uncompressed file size and modification date and time of each specified file is printed, along with totals for all files specified. If a file was archived from a single-case file system (for example, the MS-DOS FAT file system) and the -U option was not given, the filename is converted to lowercase and is prefixed with a caret (^). In addition, the archive comment and individual file comments (if any) are displayed. -p extract files to pipe (stdout). Nothing but the file data is sent to stdout, and the files are always extracted in binary format, just as they are stored (no conversions). -t test archive files. This option extracts each speci- fied file in memory and compares the CRC (cyclic redun- dancy check, an enhanced checksum) of the expanded file with the original file's stored CRC value. -u update existing files and create new ones if needed. This option performs the same function as the -f option, extracting (with query) files which are newer than those with the same name on disk, and in addition it extracts those files which do not already exist on disk. -v list archive files (verbose format). In addition to the information given by the -l option, the compression method, compressed size, compression ratio and 32-bit CRC is listed. -z display only the archive comment.MODIFIERS -a convert text files. Ordinarily all files are extracted exactly as they are stored (as ``binary'' files). The -a option causes files identified by zip as text files (those with the `t' label in zipinfo listings, rather than `b') to be automatically extracted as such, con- verting line 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) and have no end-of-file (EOF) marker; Macintoshes use car- riage 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 Sys- tem use EBCDIC rather than the more common ASCII char- acter set, and NT supports Unicode.) Note that zip's identification of text files is by no means perfect; some ``text'' files may actually be binary and vice versa. unzip therefore prints ``[text]'' or ``[binary]'' as a visual check for each file it extracts when using the -a option. The -aa option forces all files to be extracted as text, regardless of the supposed file type. -j junk paths. The archive's directory structure is not recreated; all files are deposited in the extraction directory (by default, the current one). -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 which 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. -o overwrite existing files without prompting. This is a dangerous option, so use it with care. (It is often used with -f, however.) -q perform operations quietly (-qq = even quieter). Ordi- narily unzip prints the names of the files it's extracting or testing, the extraction methods, any file or zipfile comments which 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 particu- lar does not gracefully support spaces in filenames. Conversion of spaces to underscores can eliminate the awkwardness in some cases. -U leave filenames uppercase if created under MS-DOS, VMS, etc. Depending on the archiver, files archived under single-case filesystems may be stored as all-uppercase names; this can be awkward when extracting to a case- preserving filesystem such as OS/2 HPFS or a case- sensitive one such as under Unix. By default unzip converts such filenames to lowercase; this option causes all filenames to be extracted exactly as they're stored (excepting truncation, conversion of unsupported characters, etc.).
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -