📄 zip.1
字号:
.TP.B \-V[VMS] Save VMS file attributes and use portable form..I ziparchives created with this option are truncated at EOF but still may not beusable on other systems depending on the file types being zipped..TP.B \-VV[VMS] Save VMS file attributes..I ziparchives created with this option include the entire file and should be ableto recreate most VMS files on VMS systems but these archives will generallynot be usable on other systems..TP.B \-w[VMS] Append the version number of the files to the name,including multiple versions of files. (default: use onlythe most recent version of a specified file)..TP.BI \-x\ filesExplicitly exclude the specified files, as in:.RS.IP\fCzip -r foo foo -x \\*.o\fP.RE.IPwhich will include the contents of.I fooin.I foo.zipwhile excluding all the files that end in \fI.o\fP.The backslash avoids the shell filename substitution, so that thename matching is performed by.I zipat all directory levels. If you do not escape wildcards in patternsit may seem to work but files in subdirectories will not be checkedfor matches..IPAlso possible:.RS.IP\fCzip -r foo foo -x@exclude.lst\fP.RE.IPwhich will include the contents of.I fooin.I foo.zipwhile excluding all the files that match the patterns in the file exclude.lst(each file pattern on a separate line)..TP.B \-XDo not save extra file attributes (Extended Attributes on OS/2, uid/gidand file times on Unix)..TP.B \-yStore symbolic links as such in the.I ziparchive,instead of compressing and storing the file referred to by the link(UNIX only)..TP.B \-zPrompt for a multi-line comment for the entire.I ziparchive.The comment is ended by a line containing just a period,or an end of file condition (^D on UNIX, ^Z on MSDOS, OS/2, and VMS).The comment can be taken from a file:.RS.IP\fCzip -z foo < foowhat\fP.RE.TP.BI \-#Regulate the speed of compression using the specified digit.IR # ,where.B \-0indicates no compression (store all files),.B \-1indicates the fastest compression method (less compression)and.B \-9indicates the slowest compression method (optimal compression, ignoresthe suffix list). The default compression level is.BR \-6..TP.B \-![WIN32] Use priviliges (if granted) to obtain all aspects of WinNT security..TP.B \-@Take the list of input files from standard input. Only one filename per line..TP.B \-$[MSDOS, OS/2, WIN32] Include the volume label for the drive holdingthe first file to be compressed. If you want to include only the volumelabel or to force a specific drive, use the drive name as first file name,as in:.RS.IP\fCzip -$ foo a: c:bar\fP.RE.IP.SH "EXAMPLES"The simplest example:.IP\fCzip stuff *\fP.LPcreates the archive.I stuff.zip(assuming it does not exist)and puts all the files in the current directory in it, in compressed form(the.I \&.zipsuffix is added automatically,unless that archive name given contains a dot already;this allows the explicit specification of other suffixes)..LPBecause of the way the shell does filename substitution,files starting with "." are not included;to include these as well:.IP\fCzip stuff .* *\fP.LPEven this will not include any subdirectories from the current directory..LPTo zip up an entire directory, the command:.IP\fCzip -r foo foo\fP.LPcreates the archive.IR foo.zip ,containing all the files and directories in the directory.I foothat is contained within the current directory..LPYou may want to make a.I ziparchive that contains the files in.IR foo ,without recording the directory name,.IR foo .You can use the.B \-joption to leave off the paths,as in:.IP\fCzip -j foo foo/*\fP.LPIf you are short on disk space,you might not have enough room to hold both the original directoryand the corresponding compressed.I ziparchive.In this case, you can create the archive in steps using the.B \-moption.If.I foocontains the subdirectories.IR tom ,.IR dick ,and.IR harry ,you can:.IP\fCzip -rm foo foo/tom\fP.br\fCzip -rm foo foo/dick\fP.br\fCzip -rm foo foo/harry\fP.LPwhere the first command creates.IR foo.zip ,and the next two add to it.At the completion of each.I zipcommand,the last created archive is deleted,making room for the next.I zipcommand to function..SH "PATTERN MATCHING"This section applies only to UNIX, though the ?, *, and [] specialcharacters are implemented on other systems including MSDOS and Win32.Watch this space for details on MSDOS and VMS operation..LPThe UNIX shells.RI ( sh (1)and.IR csh (1))do filename substitution on command arguments.The special characters are:.TP.B ?match any single character.TP.B *match any number of characters (including none).TP.B []match any character in the range indicated within the brackets(example: [a\-f], [0\-9])..LPWhen these characters are encountered(without being escaped with a backslash or quotes),the shell will look for files relative to the current paththat match the pattern,and replace the argument with a list of the names that matched..LPThe.I zipprogram can do the same matching on names that are in the.I ziparchive being modified or,in the case of the.B \-x(exclude) or.B \-i(include) options, on the list of files to be operated on, by usingbackslashes or quotes to tell the shell not to do the name expansion.In general, when.I zipencounters a name in the list of files to do, it first looks for the name inthe file system. If it finds it, it then adds it to the list of files to do.If it does not find it, it looks for the name in the.I ziparchive being modified (if it exists), using the pattern matching charactersdescribed above, if present. For each match, it will add that name to thelist of files to be processed, unless this name matches one givenwith the.B \-xoption, or does not match any name given with the.B \-ioption..LPThe pattern matching includes the path,and so patterns like \\*.o match names that end in ".o",no matter what the path prefix is.Note that the backslash must precede every special character (i.e. ?*[]),or the entire argument must be enclosed in double quotes ("")..LPIn general, use backslash to make.I zipdo the pattern matching with the.B \-f(freshen) and.B \-d(delete) options,and sometimes after the.B \-x(exclude) option when used with an appropriate operation (add,.BR \-u ,.BR \-f ,or.BR \-d )..SH "ENVIRONMENT".TP.B ZIPOPTcontains default options that will be used when running.I zip.TP.B ZIP[Not on RISC OS and VMS] see ZIPOPT.TP.B Zip$Options[RISC OS] see ZIPOPT.TP.B Zip$Exts[RISC OS] contains extensions separated by a : that will causenative filenames with one of the specified extensions tobe added to the zip file with basename and extension swapped..I zip.TP.B ZIP_OPTS[VMS] see ZIPOPT.SH "SEE ALSO"compress(1),shar(1L),tar(1),unzip(1L),gzip(1L).SH DIAGNOSTICSThe exit status (or error level) approximates the exit codes defined by PKWAREand takes on the following values, except under VMS:.RS.IP 0normal; no errors or warnings detected..IP 2unexpected end of zip file..IP 3a generic error in the zipfile format was detected. Processing may havecompleted successfully anyway; some broken zipfiles created by otherarchivers have simple work-arounds..IP 4\fIzip\fP was unable to allocate memory for one or more buffers duringprogram initialization..IP 5a severe error in the zipfile format was detected. Processing probablyfailed immediately..IP 6entry too large to split (with \fIzipsplit\fP), read, or write.IP 7invalid comment format.IP 8.I zip \-Tfailed or out of memory.IP 9the user aborted \fIzip\fP prematurely with control-C (or similar).IP 10\fIzip\fP encountered an error while using a temp file.IP 11read or seek error.IP 12\fIzip\fP has nothing to do.IP 13missing or empty zip file.IP 14error writing to a file.IP 15\fIzip\fP was unable to create a file to write to.IP 16bad command line parameters.IP 18\fIzip\fP could not open a specified file to read.RE.PPVMS interprets standard Unix (or PC) return values as other, scarier-lookingthings, so \fIzip\fP instead maps them into VMS-style status codes. Thecurrent mapping is as follows: 1 (success) for normal exit, and (0x7fff000? + 16*normal_zip_exit_status) for all errors, where the`?' is 0 (warning) for \fIzip\fP value 12, 2 (error) for the\fIzip\fP values 3, 6, 7, 9, 13, 16, 18,and 4 (fatal error) for the remaining ones..PD.SH BUGS.I zip2.32 is not compatible with PKUNZIP 1.10. Use.I zip1.1 to produce.I zipfiles which can be extracted by PKUNZIP 1.10..PP.I zipfiles produced by.I zip2.32 must not be.I updatedby.I zip1.1 or PKZIP 1.10, if they containencrypted members or if they have been produced in a pipe or on a non-seekabledevice. The old versions of.I zipor PKZIP would create an archive with an incorrect format.The old versions can list the contents of the zip filebut cannot extract it anyway (because of the new compression algorithm).If you do not use encryption and use regular disk files, you donot have to care about this problem..LPUnder VMS,not all of the odd file formats are treated properly.Only stream-LF format.I zipfiles are expected to work with.IR zip .Others can be converted using Rahul Dhesi's BILF program.This version of.I ziphandles some of the conversion internally.When using Kermit to transfer zip files from Vax to MSDOS, type "setfile type block" on the Vax. When transferring from MSDOS to Vax, type"set file type fixed" on the Vax. In both cases, type "set file typebinary" on MSDOS..LPUnder VMS, zip hangs for file specification that uses DECnet syntax.I foo::*.*..LPOn OS/2, \fIzip\fR cannot match some names, such as those including anexclamation mark or a hash sign. This is a bug in OS/2 itself: the32-bit DosFindFirst/Next don't find such names. Other programs suchas GNU tar are also affected by this bug..LPUnder OS/2, the amount of Extended Attributes displayed by DIR is (forcompatibility) the amount returned by the 16-bit version ofDosQueryPathInfo(). Otherwise OS/2 1.3 and 2.0 would report differentEA sizes when DIRing a file.However, the structure layout returned by the 32-bit DosQueryPathInfo()is a bit different, it uses extra padding bytes and link pointers (it'sa linked list) to have all fields on 4-byte boundaries for portabilityto future RISC OS/2 versions. Therefore the value reported by.I zip(which uses this 32-bit-mode size) differs from that reported by DIR..I zipstores the 32-bit format for portability, even the 16-bitMS-C-compiled version running on OS/2 1.3, so even this one shows the32-bit-mode size..LPDevelopment of \fIzip\fR\ 3.0 and \fIunzip\fR\ 6.0 are underway. See thosesource distributions formany new features and the latest bug fixes..SH AUTHORSCopyright (C) 1997-2006 Info-ZIP..LPCopyright (C) 1990-1997 Mark Adler, Richard B. Wales, Jean-loup Gailly,Onno van der Linden, Kai Uwe Rommel, Igor Mandrichenko, John Bush andPaul Kienitz.Permission is granted to any individual or institution to use, copy, orredistribute this software so long as all of the original files are included,that it is not sold for profit, and that this copyright noticeis retained..LPLIKE ANYTHING ELSE THAT'S FREE, ZIP AND ITS ASSOCIATED UTILITIES AREPROVIDED AS IS AND COME WITH NO WARRANTY OF ANY KIND, EITHER EXPRESSED ORIMPLIED. IN NO EVENT WILL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY DAMAGESRESULTING FROM THE USE OF THIS SOFTWARE..LPPlease send bug reports and comments to:.IR zip-bugsat.IR www.info-zip.org .For bug reports, please include the version of.IR zip(see \fIzip\ \-h\fP),the make options used to compile it (see \fIzip\ \-v\fP),the machine and operating system in use,and as much additional information as possible..SH ACKNOWLEDGEMENTSThanks to R. P. Byrne for his.I Shrink.Pasprogram, which inspired this project,and from which the shrink algorithm was stolen;to Phil Katz for placing in the public domain the.I zipfile format, compression format, and .ZIP filename extension, and foraccepting minor changes to the file format; to Steve Burg forclarifications on the deflate format; to Haruhiko Okumura and LeonidBroukhis for providing some useful ideas for the compressionalgorithm; to Keith Petersen, Rich Wales, Hunter Goatley and MarkAdler for providing a mailing list and.I ftpsite for the Info-ZIP group to use; and most importantly, to theInfo-ZIP group itself (listed in the file.IR infozip.who )without whose tireless testing and bug-fixing efforts a portable.I zipwould not have been possible.Finally we should thank (blame) the first Info-ZIP moderator,David Kirschbaum,for getting us into this mess in the first place.The manual page was rewritten for UNIX by R. P. C. Rodgers..\" end of file
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -