解压前先校验 zip 压缩包完整性

不解压任何文件,逐个校验 .zip 内所有文件的 CRC 校验值。

macOS压缩与归档完整性归档低风险
运行 unzip -t big-archive.zip,逐个验证压缩包成员,最后显示 No errors detected 或列出损坏文件。

01命令

命令
$ unzip -t big-archive.zip

02作用说明

-t 执行与解压相同的 CRC32 校验但不写盘,可以安全快速地诊断可疑压缩包:下载被截断(中央目录缺失)、光盘划伤(个别文件 CRC 失败)都能发现;带密码的压缩包测试时会提示输入密码。

03风险

风险低风险
!注意: 它不能修复任何问题——校验失败仍需重新下载或从备份恢复;可先用 unzip -l 列出内容。

04撤销

✓无需撤销——该命令不会改变持久状态。

05来源

  • unzip(1) man page
    manpagez.com · technical · 2026-09-17
    依据: The unzip man page describes -t as testing the archive: each file is extracted in memory only to verify correctness, with a 'No errors detected' summary.
  • unzip - Extract, List or Test ZIP Archives
    SS64 · technical · 2026-09-17
    依据: Documents the -t option: test archive files, checking each file's CRC against the archive without writing anything to disk.

最后验证: 2026-09-19 · 分类: 文件与文件夹

06相关方案