1. [安装 & centos7]
  2. : yum install zip -y
  3. : yum install unzip -y

zip —help & centos7

  1. Copyright (c) 1990-2008 Info-ZIP - Type 'zip "-L"' for software license.
  2. Zip 3.0 (July 5th 2008). Usage:
  3. zip [-options] [-b path] [-t mmddyyyy] [-n suffixes] [zipfile list] [-xi list]
  4. The default action is to add or replace zipfile entries from list, which
  5. can include the special name - to compress standard input.
  6. If zipfile and list are omitted, zip compresses stdin to stdout.
  7. -f freshen: only changed files -u update: only changed or new files
  8. -d delete entries in zipfile -m move into zipfile (delete OS files)
  9. -r recurse into directories -j junk (don't record) directory names
  10. -0 store only -l convert LF to CR LF (-ll CR LF to LF)
  11. -1 compress faster -9 compress better
  12. -q quiet operation -v verbose operation/print version info
  13. -c add one-line comments -z add zipfile comment
  14. -@ read names from stdin -o make zipfile as old as latest entry
  15. -x exclude the following names -i include only the following names
  16. -F fix zipfile (-FF try harder) -D do not add directory entries
  17. -A adjust self-extracting exe -J junk zipfile prefix (unzipsfx)
  18. -T test zipfile integrity -X eXclude eXtra file attributes
  19. -y store symbolic links as the link instead of the referenced file
  20. -e encrypt -n don't compress these suffixes
  21. -h2 show more help

unzip —help & centos7

  1. UnZip 6.00 of 20 April 2009, by Info-ZIP. Maintained by C. Spieler. Send
  2. bug reports using http://www.info-zip.org/zip-bug.html; see README for details.
  3. Usage: unzip [-Z] [-opts[modifiers]] file[.zip] [list] [-x xlist] [-d exdir]
  4. Default action is to extract files in list, except those in xlist, to exdir;
  5. file[.zip] may be a wildcard. -Z => ZipInfo mode ("unzip -Z" for usage).
  6. -p extract files to pipe, no messages -l list files (short format)
  7. -f freshen existing files, create none -t test compressed archive data
  8. -u update files, create if necessary -z display archive comment only
  9. -v list verbosely/show version info -T timestamp archive to latest
  10. -x exclude files that follow (in xlist) -d extract files into exdir
  11. modifiers:
  12. -n never overwrite existing files -q quiet mode (-qq => quieter)
  13. -o overwrite files WITHOUT prompting -a auto-convert any text files
  14. -j junk paths (do not make directories) -aa treat ALL files as text
  15. -U use escapes for all non-ASCII Unicode -UU ignore any Unicode fields
  16. -C match filenames case-insensitively -L make (some) names lowercase
  17. -X restore UID/GID info -V retain VMS version numbers
  18. -K keep setuid/setgid/tacky permissions -M pipe through "more" pager
  19. -O CHARSET specify a character encoding for DOS, Windows and OS/2 archives
  20. -I CHARSET specify a character encoding for UNIX and other archives
  21. See "unzip -hh" or unzip.txt for more help. Examples:
  22. unzip data1 -x joe => extract all files except joe from zipfile data1.zip
  23. unzip -p foo | more => send contents of foo.zip via pipe into program more
  24. unzip -fo foo ReadMe => quietly replace existing ReadMe if archive file newer
  1. [ZIP - 文档压缩打包]
  2. : zip [参数] [打包后的文件名] [打包的目录路径]
  3. : zip -r ./wendangming.zip ./* 压缩当前文件夹
  4. :zip –q –r wendangming.zip /home/wendangming 将/home/wendangming/目录下所有文件和文件夹打包为当前目录下wendangming.zip
  5. : zip –q –r wendangming.zip wendangming/ 将当前目录下的wendangming/目录下所有文件和文件夹打包为当前目录下wendangming.zip
  1. [ZIP - 参数]
  2. : -h 显示帮助界面
  3. : -r 递归
  4. : -q 安静模式,在压缩的时候不显示指令的执行过程
  5. : -a 将文件转成ASCII模式
  6. : -F 尝试修复损坏的压缩文件
  7. : -n 特定字符串 不压缩具有特定字尾字符串的文件
  8. : -o 将压缩文件内的所有文件的最新变动时间设为压缩时候的时间
  9. : -r 将指定的目录下的所有子目录以及文件一起处理
  10. : -S 包含系统文件和隐含文件(S是大写)
  11. : -t 日期 把压缩文件的最后修改日期设为指定的日期,日期格式为mmddyyyy
  12. : -m 将文件压缩之后,删除源文件
  1. [unzip - 文档解压]
  2. : unzip [-cflptuvz][-agCjLMnoqsVX][-P <密码>][.zip文件][文件][-d <目 录>][-x <文件>]
  3. unzip [-Z]
  1. [unzip - 参数]
  2. : -q 执行时不显示任何信息
  3. : -v 执行是时显示详细的信息
  4. : -l 显示压缩文件内所包含的文件
  5. : -t 检查压缩文件是否正确
  6. : -u 与-f参数类似,但是除了更新现有的文件外,也会将压缩文件中的其他文件解压缩到目录中
  7. : -C 压缩文件中的文件名称区分大小写
  8. : -c 将解压缩的结果显示到屏幕上,并对字符做适当的转换
  9. : -f 更新现有的文件
  10. : -j 不处理压缩文件中原有的目录路径
  11. : -p 与-c参数类似,会将解压缩的结果显示到屏幕上,但不会执行任何的转换
  12. : -P<密码> 使用zip的密码选项
  13. : -n 解压缩时不要覆盖原有的文件
  14. : -L 将压缩文件中的全部文件名改为小写
  15. : [.zip文件] 指定.zip压缩文件
  16. : [文件] 指定要处理.zip压缩文件中的哪些文件
  17. : -d<目录> 指定文件解压缩后所要存储的目录
  18. : -x<文件> 指定不要处理.zip压缩文件中的哪些文件
  19. : -z 仅显示压缩文件的备注文字
  20. : -a 对文本文件进行必要的字符转换
  21. : -b 不要对文本文件进行字符转换
  22. : -M 将输出结果送到more程序处理
  23. : -o 不必先询问用户,unzip执行后覆盖原有文件
  24. : -s 将文件名中的空白字符转换为底线字符
  25. : -V 保留VMS的文件版本信息
  26. : -X 解压缩时同时回存文件原来的UID/GID
  27. : -Z unzip -Z等于执行zipinfo指令