[安装 & centos7]
: yum install zip -y
: yum install unzip -y
zip —help & centos7
Copyright (c) 1990-2008 Info-ZIP - Type 'zip "-L"' for software license.
Zip 3.0 (July 5th 2008). Usage:
zip [-options] [-b path] [-t mmddyyyy] [-n suffixes] [zipfile list] [-xi list]
The default action is to add or replace zipfile entries from list, which
can include the special name - to compress standard input.
If zipfile and list are omitted, zip compresses stdin to stdout.
-f freshen: only changed files -u update: only changed or new files
-d delete entries in zipfile -m move into zipfile (delete OS files)
-r recurse into directories -j junk (don't record) directory names
-0 store only -l convert LF to CR LF (-ll CR LF to LF)
-1 compress faster -9 compress better
-q quiet operation -v verbose operation/print version info
-c add one-line comments -z add zipfile comment
-@ read names from stdin -o make zipfile as old as latest entry
-x exclude the following names -i include only the following names
-F fix zipfile (-FF try harder) -D do not add directory entries
-A adjust self-extracting exe -J junk zipfile prefix (unzipsfx)
-T test zipfile integrity -X eXclude eXtra file attributes
-y store symbolic links as the link instead of the referenced file
-e encrypt -n don't compress these suffixes
-h2 show more help
unzip —help & centos7
UnZip 6.00 of 20 April 2009, by Info-ZIP. Maintained by C. Spieler. Send
bug reports using http://www.info-zip.org/zip-bug.html; see README for details.
Usage: unzip [-Z] [-opts[modifiers]] file[.zip] [list] [-x xlist] [-d exdir]
Default action is to extract files in list, except those in xlist, to exdir;
file[.zip] may be a wildcard. -Z => ZipInfo mode ("unzip -Z" for usage).
-p extract files to pipe, no messages -l list files (short format)
-f freshen existing files, create none -t test compressed archive data
-u update files, create if necessary -z display archive comment only
-v list verbosely/show version info -T timestamp archive to latest
-x exclude files that follow (in xlist) -d extract files into exdir
modifiers:
-n never overwrite existing files -q quiet mode (-qq => quieter)
-o overwrite files WITHOUT prompting -a auto-convert any text files
-j junk paths (do not make directories) -aa treat ALL files as text
-U use escapes for all non-ASCII Unicode -UU ignore any Unicode fields
-C match filenames case-insensitively -L make (some) names lowercase
-X restore UID/GID info -V retain VMS version numbers
-K keep setuid/setgid/tacky permissions -M pipe through "more" pager
-O CHARSET specify a character encoding for DOS, Windows and OS/2 archives
-I CHARSET specify a character encoding for UNIX and other archives
See "unzip -hh" or unzip.txt for more help. Examples:
unzip data1 -x joe => extract all files except joe from zipfile data1.zip
unzip -p foo | more => send contents of foo.zip via pipe into program more
unzip -fo foo ReadMe => quietly replace existing ReadMe if archive file newer
[ZIP - 文档压缩打包]
: zip [参数] [打包后的文件名] [打包的目录路径]
: zip -r ./wendangming.zip ./* 压缩当前文件夹
:zip –q –r wendangming.zip /home/wendangming 将/home/wendangming/目录下所有文件和文件夹打包为当前目录下wendangming.zip
: zip –q –r wendangming.zip wendangming/ 将当前目录下的wendangming/目录下所有文件和文件夹打包为当前目录下wendangming.zip
[ZIP - 参数]
: -h 显示帮助界面
: -r 递归
: -q 安静模式,在压缩的时候不显示指令的执行过程
: -a 将文件转成ASCII模式
: -F 尝试修复损坏的压缩文件
: -n 特定字符串 不压缩具有特定字尾字符串的文件
: -o 将压缩文件内的所有文件的最新变动时间设为压缩时候的时间
: -r 将指定的目录下的所有子目录以及文件一起处理
: -S 包含系统文件和隐含文件(S是大写)
: -t 日期 把压缩文件的最后修改日期设为指定的日期,日期格式为mmddyyyy
: -m 将文件压缩之后,删除源文件
[unzip - 文档解压]
: unzip [-cflptuvz][-agCjLMnoqsVX][-P <密码>][.zip文件][文件][-d <目 录>][-x <文件>]
:unzip [-Z]
[unzip - 参数]
: -q 执行时不显示任何信息
: -v 执行是时显示详细的信息
: -l 显示压缩文件内所包含的文件
: -t 检查压缩文件是否正确
: -u 与-f参数类似,但是除了更新现有的文件外,也会将压缩文件中的其他文件解压缩到目录中
: -C 压缩文件中的文件名称区分大小写
: -c 将解压缩的结果显示到屏幕上,并对字符做适当的转换
: -f 更新现有的文件
: -j 不处理压缩文件中原有的目录路径
: -p 与-c参数类似,会将解压缩的结果显示到屏幕上,但不会执行任何的转换
: -P<密码> 使用zip的密码选项
: -n 解压缩时不要覆盖原有的文件
: -L 将压缩文件中的全部文件名改为小写
: [.zip文件] 指定.zip压缩文件
: [文件] 指定要处理.zip压缩文件中的哪些文件
: -d<目录> 指定文件解压缩后所要存储的目录
: -x<文件> 指定不要处理.zip压缩文件中的哪些文件
: -z 仅显示压缩文件的备注文字
: -a 对文本文件进行必要的字符转换
: -b 不要对文本文件进行字符转换
: -M 将输出结果送到more程序处理
: -o 不必先询问用户,unzip执行后覆盖原有文件
: -s 将文件名中的空白字符转换为底线字符
: -V 保留VMS的文件版本信息
: -X 解压缩时同时回存文件原来的UID/GID
: -Z unzip -Z等于执行zipinfo指令