「unzip」

组成

安装的可执行程序

funzip | allows the output of unzip commands to be redirected.

unzip | lists, tests or extracts files from a ZIP archive.

unzipfsx | is a self-extracting stub that can be prepended to a ZIP archive. Files in this format allow the recipient to decompress the archive without installing UnZip.

zipgrep | searches files in a ZIP archive for lines matching a pattern.

zipinfo | produces technical information about the files in a ZIP archive, including file access permissions, encryption status, type of compression, etc.

应用

解压 ZIP 文件,防止文件名乱码 | Unzipping Unicode Files

decompress ZIP with given encoding
How can I avoid broken languages when unzipping unicode files?

在 Windows 中,创建的 ZIP 文件,如果被压缩文件的文件名中包含非英文字符(比如“中文”),那么在 Linux 中解压时创建的文件名将是乱码。该笔记将记录:在 Linux 中,如何解压在 Windows 下创建的 ZIP 文件,以防止文件名出现乱码。

针对问题,理论上是与发行版无关的,但是鉴于各个发行版会选择不同版本的软件及不同的编译选项,所以实际情况还是会与发行版相关。

通过 unzip 命令:

unzip -O gb18030 file.zip

# CentOS
# Ubuntu 25.04

在 Debian 中,其 unzip 命令没有 -O 选项。可以使用 unar 命令:

apt-get install unar
unar -e gb18030 file.zip

补充说明:
1)该方法适用于 Ubuntu 20.04 LTS(压缩包来自 Windows 7)

[WIP] 这里需要了解一下字符集相关的内容。

参考

BLFS / UnZip-6.0 / http://www.linuxfromscratch.org/blfs/view/7.10-systemd/general/unzip.html