zip打包,unzip解包
来源:互联网 发布:数空车床编程视频教程 编辑:程序博客网 时间:2024/06/05 22:51
1、简单描述
zip用于压缩文件并将文件打包。
unzip与zip相反,解包并解压缩。
2、通过例子说明zip使用方法
(1)、zip命令的使用格式大致是这样的:
zip zipfile file1 file2 file3
以上命令是将file1,file2,file3三个文件先压缩,然后再将这三个压缩后的文件打包到zipfile.zip文件中。
(2)、关于打包后的后缀
zip zipfile.txt file1 file2 file3
以上命令将file1,file2,file3三个文件先压缩,然后再将这三个压缩后的文件打包到zipfile.txt文件中。
(3)打包后原文件是否存留
zip -m zipfile file1 file2 file3
以上命令打包后file1,file2,file3文件已经不存在了,因为选项-m的作用。假如没有-m选项,打包后原文件仍存留。
(4)向打包后的文档中加入评论
zip -z zipfile file1 file2 file3
以上命令执行后,终端会提示你加入评论信息,加入即可。对加入的评论信息,unzip解包时可以查看。
(5)向包中加入包中已有的包会怎样
zip zipfile file1
以上命令执行时,如果zipfile或zipfile.zip已经存在,且其中已经包含file1文件,那么以上命令会更新zipfile包中的file1文件。
还有很多选项,这里不一一介绍,将zip使用文档中的内容粘贴到下面:
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 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 -R PKZIP recursion (see manual) -e encrypt -n don't compress these suffixes
3、unzip的使用
(1)、unzip的使用方法大概是这样的
unzip zipfile.zip
以上命令,将zipfile.zip包解包,并且将其中的文件解压缩。
(2)只解压出一部分文件
unzip zipfile.zip file1 file2
无论zipfile包中有多少个文件,以上命令只解压出file1,file2两个文件。
(3)、查看压缩包中的评论信息
unzip -z zipfile
以上命令查看zipfile.zip包中的评论信息。这些评论信息是打包的时候用-z选项写进去的。
这里对unzip命令的选项不一一介绍,下面粘贴unzip使用文档中的描述:
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 -x exclude files that follow (in xlist) -d extract files into exdirmodifiers: -q quiet mode (-qq => quieter) -n never overwrite existing files -a auto-convert any text files -o overwrite files WITHOUT prompting -aa treat ALL files as text -j junk paths (do not make directories) -v be verbose/print version info -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" pagerExamples (see unzip.txt for more info): 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打包,unzip解包
- vc zip,unzip打包,解包
- ZIP打包解包
- tar、zip 、unzip 打包与压缩
- macOS zip 打包加密和 unzip 解压
- zip/unzip
- zip&unzip
- ubuntu unrar解压rar包和unzip 解压zip包
- ubuntu unrar解压rar包和unzip 解压zip包
- 每天linux命令_压缩打包zip&unzip
- gzip,bzip2, xz , zip ,unzip ,解压,压缩;tar打包,解压。
- 文件夹打包成ZIP包
- Aix 压缩、打包、解压、解包 tar zip gz
- linux下zip命令打包与解包
- linux下zip命令打包与解包
- linux下zip命令打包与解包
- linux下zip命令打包与解包
- linux下zip命令打包与解包
- 如何打造像样的应用日志——10条秘诀
- 200910
- Shell 获取当前执行脚本的路径
- 200906
- 黑马程序员 面对对象(二)
- zip打包,unzip解包
- 从此记录我的ACM生涯
- iOS里的MVC
- 简明 Vim 练级攻略
- 数据库 变量查询 字符串转换
- Android 关机流程分析-----(2)JNI和kernel层
- 输入输出外挂
- 几个好的网址
- JAVA之关于swing窗体设置默认焦点