Linux下使用zip命令加密压缩/解压文件 zip、unzip、unar

35 篇文章 0 订阅
3 篇文章 0 订阅

Linux下使用zip命令加密压缩/解压文件

一、zip命令加密压缩解压

压缩方法一

zip -re *.zip files1 files2

压缩
在这里插入图片描述
在这里插入图片描述

在这里插入图片描述

压缩方法二

zip -q -r -P passwordd *.zip files1 files2

passwordd 为设置的密码

解压方式一
在这里插入图片描述
解压方式二
在这里插入图片描述

二、zip命令参数

在这里插入图片描述

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

-r 递归,将指定目录下的所有文件和子目录一并处理
-S 包含系统和隐藏文件
-y 直接保存符号连接,而非该连接所指向的文件
-X 不保存额外的文件属性
-m 将文件压缩并加入压缩文件后,删除源文件-<压缩级别> 1~9,数字越大压缩率越高
-F 尝试修复已损坏的压缩文件
-T 检查备份文件内的每个文件是否正确无误
-q 不显示指令执行过程
-g 将文件压缩后附加在既有的压缩文件之后,而非另行建立新的压缩文件
-u 更新压缩包内文件
-f 更新压缩包内文件。如果符合条件的文件没有包含在压缩包中,则压缩后添加
-$ 保存第一个被压缩文件所在磁盘的卷标
-j 只保存文件名称及其内容
-D 压缩文件内不建立目录名称
-e 设置密码
-i <表达式> 压缩目录时,只压缩符合条件的文件
-x <表达式> 排除符合条件的文件
-n <文件名后缀> 排除指定文件名后缀的文件
-b <缓存路径> 指定临时文件目录
-d <表达式> 从压缩文件内删除指定的文件
-t <日期时间> 把压缩文件的日期设成指定的日期
-o 以压缩文件内拥有最新更改时间的文件为准,将压缩文件的更改时间设成和该文件相同
-A 调整可执行的自动解压缩文件
-c 替每个被压缩的文件加上注释
-z 替压缩文件加上注释
-k 使用MS-DOS兼容格式的文件名称。
-l 压缩文件时,把LF字符置换成LF+CR字符。
-ll 压缩文件时,把LF+CR字符置换成LF字符。

  • 1
    点赞
  • 7
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值