📄 zip.1
字号:
transferred in ascii mode instead of binary. After the repair, the.B \-toption of.I unzipmay show that some files have a bad CRC. Such files cannot be recovered;you can remove them from the archive using the.B \-doption of.I zip..TP.B \-gGrow (append to) the specified.I ziparchive, instead of creating a new one. If this operation fails,.I zipattempts to restore the archive to its original state. If the restorationfails, the archive might become corrupted. This option is ignored whenthere's no existing archive or when at least one archive member must beupdated or deleted..TP.B \-hDisplay the.I ziphelp information (this also appears if.I zipis run with no arguments)..TP.BI \-i\ filesInclude only the specified files, as in:.RS.IP\fCzip -r foo . -i \\*.c\fP.RE.IPwhich will include only the files that end in.IR \& .cin the current directory and its subdirectories. (Note for PKZIPusers: the equivalent command is.RS.IP\fCpkzip -rP foo *.c\fP.RE.IPPKZIP does not allow recursion in directories other than the current one.)The backslash avoids the shell filename substitution, so that thename matching is performed by.I zipat all directory levels..IPAlso possible:.RS.IP\fCzip -r foo . -i@include.lst\fP.RE.IPwhich will only include the files in the current directory and itssubdirectories that match the patterns in the file include.lst..TP.B \-IDon't scan through Image files. This option is available on Acorn RISC OS only;when used, zip will not consider Image files (eg. DOS partitions or Sparkarchives when SparkFS is loaded) as directories but will store them as singlefiles.For example, if you have SparkFS loaded, zipping a Spark archive will resultin a zipfile containing a directory (and its content) while using the 'I'option will result in a zipfile containing a Spark archive. Obviously thissecond case will also be obtained (without the 'I' option) if SparkFS isn'tloaded..TP.B \-jStore just the name of a saved file (junk the path), and do not storedirectory names. By default,.I zipwill store the full path (relative to the current path)..TP.B \-JStrip any prepended data (e.g. a SFX stub) from the archive..TP.B \-kAttempt to convert the names and paths to conform to MSDOS,store only the MSDOS attribute (just the user write attribute from UNIX),and mark the entry as made under MSDOS (even though it was not);for compatibility with PKUNZIP under MSDOS which cannot handle certainnames such as those with two dots..TP.B \-lTranslate the Unix end-of-line character LF into theMSDOS convention CR LF. This option should not be used on binary files.This option can be used on Unix if the zip file is intended for PKUNZIPunder MSDOS. If the input files already contain CR LF, this option addsan extra CR. This ensure that.I unzip -aon Unix will get back an exact copy of the original file,to undo the effect of.I zip -l..TP.B \-llTranslate the MSDOS end-of-line CR LF into Unix LF.This option should not be used on binary files.This option can be used on MSDOS if the zip file is intended for unzipunder Unix..TP.B \-LDisplay the.I ziplicense..TP.B \-mMove the specified files into the.I ziparchive; actually,this deletes the target directories/files after making the specified.I ziparchive. If a directory becomes empty after removal of the files, thedirectory is also removed. No deletions are done until.I ziphas created the archive without error.This is useful for conserving disk space,but is potentially dangerous so it is recommended to use it incombination with.B \-Tto test the archive before removing all input files..TP.BI \-n\ suffixesDo not attempt to compress files named with the given.I suffixes.Such files are simply stored (0% compression) in the output zip file,so that.I zipdoesn't waste its time trying to compress them.The suffixes are separated byeither colons or semicolons. For example:.RS.IP\fCzip -rn .Z:.zip:.tiff:.gif:.snd foo foo\fP.RE.IPwill copy everything from.I foointo.IR foo.zip ,but will store any files that end in.IR .Z ,.IR .zip ,.IR .tiff ,.IR .gif ,or.I .sndwithout trying to compress them(image and sound files often have their own specialized compression methods).By default,.I zipdoes not compress files with extensions in the list.I .Z:.zip:.zoo:.arc:.lzh:.arj.Such files are stored directly in the output archive.The environment variable ZIPOPT can be used to change the default options. Forexample under Unix with csh:.RS.IPsetenv ZIPOPT "-n .gif:.zip".RE.IPTo attempt compression on all files, use:.RS.IPzip -n : foo.RE.IPThe maximum compression option.B \-9also attempts compression on all files regardless of extension..IPOn Acorn RISC OS systems the suffixes are actually filetypes (3 hex digitformat). By default, zip does not compress files with filetypes in the listDDC:D96:68E (i.e. Archives, CFS files and PackDir files)..TP.B \-NSave Amiga filenotes as zipfile comments. They can be restored by using the-N option of unzip. This option is available on the Amiga only. If -c isused also, you are prompted for comments only for those files that do nothave filenotes..TP.B \-oSet the "last modified" time of the.I ziparchive to the latest (oldest) "last modified" timefound among the entries in the.I ziparchive.This can be used without any other operations, if desired.For example:.IP\fCzip -o foo\fP.IPwill change the last modified time of.I foo.zipto the latest time of the entries in.IR foo.zip ..TP.IP \fB\-P\fP\ \fIpassword\fPuse \fIpassword\fP to encrypt 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 \-qQuiet mode;eliminate informational messages and comment prompts.(Useful, for example, in shell scripts and background tasks)..TP.B \-rTravel the directory structure recursively;for example:.RS.IP\fCzip -r foo foo\fP.RE.IPIn this case, all the files and directories in.I fooare saved in a.I ziparchive named.IR foo.zip ,including files with names starting with ".",since the recursion does not use the shell's file-name substitution mechanism.If you wish to include only a specific subset of the files in directory.I fooand its subdirectories, use the.B \-ioption to specify the pattern of files to be included.You should not use.B \-rwith the name ".*",since that matches ".."which will attempt to zip up the parent directory(probably not what was intended)..TP.B \-RTravel the directory structure recursively starting at thecurrent directory;for example:.RS.IP\fCzip -R foo *.c\fP.RE.IPIn this case, all the files matching *.c in the tree starting at thecurrent directory are stored into a.I ziparchive named.IR foo.zip .Note for PKZIP users: the equivalent command is.RS.IP\fCpkzip -rP foo *.c\fP.RE.TP.B \-SInclude system and hidden files. This option iseffective on some systems only; it is ignored on Unix..TP.BI \-t\ mmddyyyyDo not operate on files modified prior to the specified date,where.I mmis the month (0-12),.I ddis the day of the month (1-31),and.I yyyyis the year.For example:.RS.IP\fCzip -rt 12071991 infamy foo\fP.RE.IPwill add all the files in.I fooand its subdirectories that were last modified on or after 7 December 1991,to the.I ziparchive.IR infamy.zip ..TP.BI \-tt\ mmddyyyyDo not operate on files modified after or at the specified date,where.I mmis the month (0-12),.I ddis the day of the month (1-31),and.I yyyyis the year.For example:.RS.IP\fCzip -rtt 11301995 infamy foo\fP.RE.IPwill add all the files in.I fooand its subdirectories that were last modified before the 30 November 1995,to the.I ziparchive.IR infamy.zip ..TP.B \-TTest the integrity of the new zip file. If the check fails, the old zip fileis unchanged and (with the.B -moption) no input files are removed..TP.B \-uReplace (update) an existing entry in the.I ziparchive only if it has been modified more recentlythan the version already in the.I ziparchive.For example:.RS.IP\fCzip -u stuff *\fP.RE.IPwill add any new files in the current directory,and update any files which have been modified since the.I ziparchive.I stuff.zipwas last created/modified (note that.I zipwill not try to pack.I stuff.zipinto itself when you do this)..IPNote that the.B \-uoption with no arguments acts like the.B \-f(freshen) option..TP.B \-vVerbose mode or print diagnostic version info..IPNormally, when applied to real operations, this option enables the display of aprogress indicator during compression and requests verbose diagnosticinfo about zipfile structure oddities..IPWhen.B \-vis the only command line argument, and stdout is not redirected to a file,a diagnostic screen is printed. In addition to the help screen headerwith program name, version, and release date, some pointers to the Info-ZIPhome and distribution sites are given. Then, it shows information about thetarget environment (compiler type and version, OS version, compilation dateand the enabled optional features used to create the.I zipexecutable..TP.B \-VSave VMS file attributes. This option is available on VMS only;.I ziparchives created with this option will generally not be usableon other systems..TP.B \-wAppend the version number of the files to the name,including multiple versions of files.(VMS only; default:use only the 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
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -