请知悉:本文最近一次更新为 3年 前,文中内容可能已经过时。

最近需要unzip带密码解压一些文件,遂整理了下参数。

unzip -h

可以得到帮助信息:

UnZip 6.00 of 20 April 2009, by Info-ZIP.  Maintained by C. Spieler.  Send
bug reports using https://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
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

机器翻译如下:

用法:解压 [-Z] [-opts[modifiers]] 文件 [.zip] [list] [-x xlist] [-d exdir]
默认操作是将列表中的文件(xlist 中的除外)提取到 exdir;
file[.zip] 可能是通配符。 -Z => ZipInfo 模式(“解压缩 -Z”以供使用)。

-p 将文件提取到管道,没有消息 -l 列出文件(短格式)
-f 刷新现有文件,不创建 -t 测试压缩存档数据
-u 更新文件,必要时创建 -z 仅显示存档注释
-v 详细列出/显示版本信息 -T 时间戳存档到最新
-x 排除后面的文件(在 xlist 中) -d 将文件提取到 exdir
修饰符:
-n 从不覆盖现有文件 -q 安静模式(-qq => 更安静)
-o 覆盖文件而不提示 -a 自动转换任何文本文件
-j 垃圾路径(不要创建目录) -aa 将所有文件视为文本
-U 对所有非 ASCII Unicode 使用转义符 -UU 忽略任何 Unicode 字段
-C 不区分大小写匹配文件名 -L 使(某些)名称小写
-X 恢复 UID/GID 信息 -V 保留 VMS 版本号
-K 保留 setuid/setgid/tacky 权限 -M 管道通过“更多”寻呼机
有关更多帮助,请参阅“unzip -hh”或 unzip.txt。例子:
unzip data1 -x joe => 从 zipfile data1.zip 中提取除 joe 之外的所有文件
解压 -p foo | more => 通过管道将 foo.zip 的内容发送到程序中
unzip -fo foo ReadMe => 如果存档文件更新,则悄悄替换现有的自??述文件

-P 密码,可以使用指定密码解压文件。


如您从本文得到了有价值的信息或帮助,请考虑扫描文末二维码捐赠和鼓励。

尊重他人劳动成果。转载请务必附上原文链接,我将感激不尽。


与《unzip 命令行参数》相关的博文:


留言

avatar
😀
😀😁😂😅😭🤭😋😘🤔😰😱🤪💪👍👎🤝🌹👌