📄 manual
字号:
than the current one.) The backslash avoids the shell filename substitution, so that the name matching is performed by zip at all directory lev- els. Also possible: zip -r foo . -i@include.lst which will only include the files in the current directory and its subdirectories that match the patterns in the file include.lst. -I Don'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 Spark archives when SparkFS is loaded) as direc- tories but will store them as single files. For example, if you have SparkFS loaded, zipping a Spark archive will result in a zipfile containing a directory (and its content) while using the 'I' option will result in a zipfile containing a Spark archive. Obviously this second case will also be obtained (without the 'I' option) if SparkFS isn't loaded. -j Store just the name of a saved file (junk the path), and do not store directory names. By default, zip will store the full path (relative to the current path). -J Strip any prepended data (e.g. a SFX stub) from the archive. -k Attempt 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 certain names such as those with two dots. -l Translate the Unix end-of-line character LF into the MSDOS 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 PKUNZIP under MSDOS. If the input files already contain CR LF, this option adds an extra CR. This ensure that unzip -a on Unix will get back an exact copy of the original file, to undo the effect of zip -l. -ll Translate the MSDOS end-of-line CR LF into Unix LF. This option should not be used on binary files.Info-ZIP 22 June 1997 (v2.2) 6ZIP(1L) ZIP(1L) This option can be used on MSDOS if the zip file is intended for unzip under Unix. -L Display the zip license. -m Move the specified files into the zip archive; actually, this deletes the target directories/files after making the specified zip archive. If a direc- tory becomes empty after removal of the files, the directory is also removed. No deletions are done until zip has created the archive without error. This is useful for conserving disk space, but is potentially dangerous so it is recommended to use it in combination with -T to test the archive before removing all input files. -n suffixes Do not attempt to compress files named with the given suffixes. Such files are simply stored (0% compression) in the output zip file, so that zip doesn't waste its time trying to compress them. The suffixes are separated by either colons or semicolons. For example: zip -rn .Z:.zip:.tiff:.gif:.snd foo foo will copy everything from foo into foo.zip, but will store any files that end in .Z, .zip, .tiff, .gif, or .snd without trying to compress them (image and sound files often have their own spe- cialized compression methods). By default, zip does not compress files with extensions in the list .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. For example under Unix with csh: setenv ZIPOPT "-n .gif:.zip" To attempt compression on all files, use: zip -n : foo The maximum compression option -9 also attempts compression on all files regardless of extension. On Acorn RISC OS systems the suffixes are actually filetypes (3 hex digit format). By default, zip does not compress files with filetypes in the list DDC:D96:68E (i.e. Archives, CFS files and PackDir files). -N Save Amiga filenotes as zipfile comments. They can be restored by using the -N option of unzip. ThisInfo-ZIP 22 June 1997 (v2.2) 7ZIP(1L) ZIP(1L) option is available on the Amiga only. If -c is used also, you are prompted for comments only for those files that do not have filenotes. -o Set the "last modified" time of the zip archive to the latest (oldest) "last modified" time found among the entries in the zip archive. This can be used without any other operations, if desired. For example: zip -o foo will change the last modified time of foo.zip to the latest time of the entries in foo.zip. -P password use password to encrypt zipfile entries (if any). THIS IS INSECURE! Many multi-user operating sys- tems provide ways for any user to see the current command line of any other user; even on stand-alone systems there is always the threat of over-the- shoulder peeking. Storing the plaintext password as part of a command line in an automated script is even worse. Whenever possible, use the non-echo- ing, interactive prompt to enter passwords. (And where security is truly important, use strong encryption such as Pretty Good Privacy instead of the relatively weak encryption provided by standard zipfile utilities.) -q Quiet mode; eliminate informational messages and comment prompts. (Useful, for example, in shell scripts and background tasks). -r Travel the directory structure recursively; for example: zip -r foo foo In this case, all the files and directories in foo are saved in a zip archive named foo.zip, including files with names starting with ".", since the recursion does not use the shell's file-name sub- stitution mechanism. If you wish to include only a specific subset of the files in directory foo and its subdirectories, use the -i option to specify the pattern of files to be included. You should not use -r with the name ".*", since that matches ".." which will attempt to zip up the parent directory (probably not what was intended). -R Travel the directory structure recursively starting at the current directory; for example:Info-ZIP 22 June 1997 (v2.2) 8ZIP(1L) ZIP(1L) zip -R foo *.c In this case, all the files matching *.c in the tree starting at the current directory are stored into a zip archive named foo.zip. Note for PKZIP users: the equivalent command is pkzip -rP foo *.c -S Include system and hidden files. This option is effective on some systems only; it is ignored on Unix. -t mmddyyyy Do not operate on files modified prior to the spec- ified date, where mm is the month (0-12), dd is the day of the month (1-31), and yyyy is the year. For example: zip -rt 12071991 infamy foo will add all the files in foo and its subdirecto- ries that were last modified on or after 7 December 1991, to the zip archive infamy.zip. -tt mmddyyyy Do not operate on files modified after or at the specified date, where mm is the month (0-12), dd is the day of the month (1-31), and yyyy is the year. For example: zip -rtt 11301995 infamy foo will add all the files in foo and its subdirecto- ries that were last modified before the 30 November 1995, to the zip archive infamy.zip. -T Test the integrity of the new zip file. If the check fails, the old zip file is unchanged and (with the -m option) no input files are removed. -u Replace (update) an existing entry in the zip archive only if it has been modified more recently than the version already in the zip archive. For example: zip -u stuff * will add any new files in the current directory, and update any files which have been modified since the zip archive stuff.zip was last created/modified (note that zip will not try to pack stuff.zip into itself when you do this).Info-ZIP 22 June 1997 (v2.2) 9ZIP(1L) ZIP(1L) Note that the -u option with no arguments acts like the -f (freshen) option. -v Verbose mode or print diagnostic version info. Normally, when applied to real operations, this option enables the display of a progress indicator during compression and requests verbose diagnostic info about zipfile structure oddities. When -v is the only command line argument, and std- out is not redirected to a file, a diagnostic screen is printed. In addition to the help screen header with program name, version, and release date, some pointers to the Info-ZIP home and dis- tribution sites are given. Then, it shows informa- tion about the target environment (compiler type and version, OS version, compilation date and the enabled optional features used to create the zip executable. -V Save VMS file attributes. This option is available on VMS only; zip archives created with this option will generally not be usable on other systems. -w Append 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). -x files Explicitly exclude the specified files, as in: zip -r foo foo -x \*.o which will include the contents of foo in foo.zip while excluding all the files that end in .o. The backslash avoids the shell filename substitution, so that the name matching is performed by zip at all directory levels. Also possible: zip -r foo foo -x@exclude.lst which will include the contents of foo in foo.zip while excluding all the files that match the pat- terns in the file exclude.lst. -X Do not save extra file attributes (Extended Attributes on OS/2, uid/gid and file times on Unix). -y Store symbolic links as such in the zip archive,Info-ZIP 22 June 1997 (v2.2) 10ZIP(1L) ZIP(1L) instead of compressing and storing the file referred to by the link (UNIX only). -z Prompt for a multi-line comment for the entire zip archive. The comment is ended by a line containing just a period, or an end of file condition (^D on
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -