搜索
 找回密码
 立即注册
发新帖

bat教程[283] zip压缩

时间:2020-6-11 23:01 0 1452 | 复制链接 |

610

主题

610

帖子

0

积分

网站编辑

Rank: 8Rank: 8

积分
0
本帖最后由 O'Reilly 于 2020-6-13 21:30 编辑

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

(2)zip命令的示例
示例1
  1. cd C:\Users\86137\Desktop\curl & zip -q -r curl.zip *
复制代码
  1. zip -r yasuo.zip abc.txt dir1
复制代码

示例2
从压缩文件中删除文件
  1. C:\Users\86137\Desktop\curl>zip -d curl.zip curl.cmd
  2. deleting: curl.cmd
复制代码

示例3
排除文件压缩
  1. C:\Users\86137\Desktop\curl>zip -r curl.zip * -x curl.cmd
  2.   adding: curl/ (164 bytes security) (stored 0%)
  3.   adding: curl/curl-ca-bundle.crt (164 bytes security) (deflated 43%)
  4.   adding: curl/curl.exe (164 bytes security) (deflated 51%)
  5.   adding: curl/libcurl.dll (164 bytes security) (deflated 50%)
复制代码

示例4
  1. zip -r test.zip * -P 123  #设置密码(明文设置密码不太安全)
  2. zip -r test.zip * -e   #交互设置密码(安全)
复制代码

示例5
设置压缩比 -0不压缩,-9最高压缩,默认为-6
  1. zip test.zip test.txt -6
复制代码

zip命令下载链接: zip.rar (30.44 KB, 下载次数: 0)
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

快速回复 返回列表 返回顶部