⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 unzip.1

📁 完整的解压zip文件的源码。包含密码功能
💻 1
📖 第 1 页 / 共 3 页
字号:
[MacOS only] ignore MacOS extra fields.  All Macintosh specific infois skipped. Data-fork and resource-fork are restored as separate files..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,etc.); this option causes the names of all files from certain systems to beconverted to lowercase..TP.B \-Mpipe all output through an internal pager similar to the Unix\fImore\fP(1)command.  At the end of a screenful of output, \fIunzip\fP pauses with a``\-\-More\-\-'' prompt; the next screenful may be viewed by pressing theEnter (Return) key or the space bar.  \fIunzip\fP can be terminated bypressing the ``q'' key and, on some systems, the Enter/Return key.  UnlikeUnix \fImore\fP(1), there is no forward-searching or editing capability.Also, \fIunzip\fP 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 likelihoodthat some text will scroll off the top of the screen before being viewed.On some systems the number of available lines on the screen is not detected,in which case \fIunzip\fP assumes the height is 24 lines..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 that 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 \-N[Amiga] extract file comments as Amiga filenotes.  File comments are createdwith the \-c option of \fIzip\fP(1L), or with the \-N option of the Amiga portof \fIzip\fP(1L), which stores filenotes as comments..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, and is the onlyway to overwrite directory EAs under OS/2.).TP.IP \fB\-P\fP\ \fIpassword\fPuse \fIpassword\fP to decrypt encrypted zipfile entries (if any).  \fBTHIS ISINSECURE!\fP  Many multi-user operating systems provide ways for any user tosee the current command line of any other user; even on stand-alone systemsthere is always the threat of over-the-shoulder peeking.  Storing the plaintextpassword 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 PrettyGood Privacy instead of the relatively weak encryption provided by standardzipfile utilities.).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 that 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 extractsfilenames with spaces intact (e.g., ``\fCEA\ DATA.\ SF\fR'').  This can beawkward, however, since MS-DOS in particular does not gracefully supportspaces in filenames.  Conversion of spaces to underscores can eliminate theawkwardness in some cases..TP.B \-U(obsolete; to be removed in a future release) leave filenames uppercase ifcreated 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;##\fR.  By default the ``\fC;##\fR'' versionnumbers are stripped, but this option allows them to be retained.  (Onfile systems that limit filenames to particularly short lengths, the versionnumbers may be truncated or stripped regardless of this option.).TP.B \-X[VMS, Unix, OS/2, NT] restore owner/protection info (UICs) under VMS, or userand group info (UID/GID) under Unix, or access control lists (ACLs) undercertain network-enabled versions of OS/2 (Warp Server with IBM LANServer/Requester 3.0 to 5.0; Warp Connect with IBM Peer 1.0), or security ACLsunder Windows NT.  In most cases this will require special system privileges,and doubling the option (\fB\-XX\fP) under NT instructs \fIunzip\fP to useprivileges for extraction; but under Unix, for example, a user who belongs toseveral groups can restore files owned by any of those groups, as long as theuser IDs match his or her own.  Note that ordinary file attributes are alwaysrestored--this option applies only to optional, extra ownership info availableon some operating systems.  [NT's access control lists do not appear to beespecially compatible with OS/2's, so no attempt is made at cross-platformportability of access privileges.  It is not clear under what conditions thiswould ever be useful anyway.].TP.B \-$.\" Amiga support possible eventually, but not yet[MS-DOS, OS/2, NT] 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 textfiles by default, make it convert filenames from uppercase systems tolowercase, 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:.PP.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.PPEnvironment 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 thequiet-flags in the example above, use the command.PP.Y "unzip \-\-q[\fIother options\fC] zipfile".PPThe first hyphen is the normalswitch 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 cancelboth quiet flags, two (or more) minuses may be used:.PP.PD 0.Y "unzip \-t\-\-q zipfile".Y "unzip \-\-\-qt zipfile".PD.PP(the two are equivalent).  This may seem awkwardor confusing, but it is reasonably intuitive:  just ignore the firsthyphen and go from there.  It is also consistent with the behavior ofUnix \fInice\fP(1)..PPAs suggested by the examples above, the default variable names are UNZIP_OPTSfor VMS (where the symbol used to install \fIunzip\fP as a foreign commandwould otherwise be confused with the environment variable), and UNZIPfor all other operating systems.  For compatibility with \fIzip\fP(1L),UNZIPOPT is also accepted (don't ask).  If both UNZIP and UNZIPOPTare defined, however, UNZIP takes precedence.  \fIunzip\fP's diagnosticoption (\fB\-v\fP with no zipfile name) can be used to check the valuesof all four possible \fIunzip\fP and \fIzipinfo\fP environment variables..PPThe timezone variable (TZ) should be set according to the local timezonein order for the \fB\-f\fP and \fB\-u\fP to operate correctly.  See thedescription of \fB\-f\fP above for details.  This variable may also benecessary in order for timestamps on extracted files to be set correctly.Under Windows 95/NT \fIunzip\fP should know the correct timezone even ifTZ is unset, assuming the timezone is correctly set in the Control Panel..PD.\" =========================================================================.SH DECRYPTIONEncrypted archives are fully supported by Info-ZIP software, but due toUnited States export restrictions, the encryption and decryption sourcesare not packaged with the regular \fIunzip\fP and \fIzip\fP distributions.Since the crypt sources were written by Europeans, however, they arefreely available at sites throughout the world; see the file ``WHERE'' inany Info-ZIP source or binary distribution for locations both inside andoutside the US..PPBecause of the separate distribution, not all compiled versions of \fIunzip\fPsupport decryption.  To check a version for crypt support, either attempt totest or extract an encrypted archive, or else check \fIunzip\fP's diagnosticscreen (see the \fB\-v\fP option above) for ``\fC[decryption]\fR'' as one ofthe special compilation options..PPAs noted above, the \fB\-P\fP option may be used to supply a password onthe command line, but at a cost in security.  The preferred decryptionmethod is simply to extract normally; if a zipfile member is encrypted,\fIunzip\fP will prompt for the password without echoing what is typed.\fIunzip\fP continues to use the same password as long as it appears to bevalid, by testing a 12-byte header on each file.  The correct password willalways check out against the header, but there is a 1-in-256 chance that anincorrect password will as well.  (This is a security feature of the PKWAREzipfile format; it helps prevent brute-force attacks that might otherwisegain a large speed advantage by testing only the header.)  In the case thatan incorrect password is given but it passes the header test anyway, eitheran incorrect CRC will be generated for the extracted data or else \fIunzip\fPwill fail during the extraction because the ``decrypted'' bytes do notconstitute a valid compressed data stream..PPIf the first password fails the header check on some file, \fIunzip\fP willprompt for another password, and so on until all files are extracted.  Ifa password is not known, entering a null password (that is, just a carriagereturn or ``Enter'') is taken as a signal to skip all further prompting.Only unencrypted files in the archive(s) will thereafter be extracted.  (Infact, that's not quite true; older versions of \fIzip\fP(1L) and\fIzipcloak\fP(1L) allowed null passwords, so \fIunzip\fP checks each encryptedfile to see if the null password works.  This may result in ``false positives''and extraction errors, as noted above.).PPArchives encrypted with 8-bit passwords (for example, passwords with accentedEuropean characters) may not be portable across systems and/or otherarchivers.  This problem stems from the use of multiple encoding methods forsuch characters, including Latin-1 (ISO 8859-1) and OEM code page 850.  DOS\fIPKZIP\fP 2.04g uses the OEM code page; Windows \fIPKZIP\fP 2.50 usesLatin-1 (and is therefore incompatible with DOS \fIPKZIP\fP); Info-ZIP usesthe OEM code page on DOS, OS/2 and Win3.x ports but Latin-1 everywhereelse; and Nico Mak's \fIWinZip\fP 6.x does not allow 8-bit passwords at all.\fIUnZip\fP 5.3 attempts to use the default character set first (e.g.,Latin-1), followed by the alternate one (e.g., OEM code page) to testpasswords.  On EBCDIC systems, if both of these fail, EBCDIC encoding willbe tested as a last resort.  (Since there are no known archivers that encryptusing EBCDIC encoding, EBCDIC is not tested on non-EBCDIC systems.)  ISOcharacter encodings other than Latin-1 are not supported..PD.\" =========================================================================.SH EXAMPLESTo use \fIunzip\fP to extract all members of the archive \fIletters.zip\fPinto the current directory and subdirectories below it, creating anysubdirectories as necessary:.PP.Y "unzip letters".PPTo extract all members of \fIletters.zip\fP into the current directory only:.PP.Y "unzip -j letters".PPTo test \fIletters.zip\fP, printing only a summary message indicatingwhether the archive is OK or not:.PP.Y "unzip -tq letters".PPTo test \fIall\fP zipfiles in the current directory, printing only thesummaries:.PP.Y "unzip -tq \e*.zip".PP(The backslash before the asterisk is only required if the shell expandswildcards, as in Unix; double quotes could have been used instead, as inthe source examples below.)\ \ To extract to standard output all members of\fIletters.zip\fP whose names end in \fI.tex\fP, auto-converting to thelocal end-of-line convention and piping the output into \fImore\fP(1):.PP.Y "unzip \-ca letters \e*.tex | more".PPTo extract the binary file \fIpaper1.dvi\fP to standard output and pipe itto a printing program:.PP.Y "unzip \-p articles paper1.dvi | dvips".PPTo extract all FORTRAN and C source files--*.f, *.c, *.h, and Makefile--intothe /tmp directory:

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -