用 unzip 解压 ZIP 压缩包到指定文件夹
把压缩包解到指定目录,并清楚看到每个解出的文件。
运行 unzip archive.zip -d 目标文件夹,即可把压缩包解压到该目录。
01命令
命令
$ unzip ~/Downloads/archive.zip -d ~/Documents/Extracted02作用说明
-d 参数会把文件解到指定文件夹(不存在会自动创建),避免散落在当前目录。对来历不明的压缩包,先用 unzip -l archive.zip 只看清单不解压。如果中文文件名乱码,加 -O UTF-8 指定编码;想只解压其中一个文件,在 zip 路径后面写上文件名即可。
03风险
!注意: 同名文件默认会跳过或询问;用 -o 是刻意覆盖,不要顺手乱加。
04撤销
✓无需撤销——该命令不会改变持久状态。
05来源
- unzip – Extract files from a ZIP archive依据: unzip -d dir extracts the archive into the named directory, creating it if needed; unzip -l lists contents without extracting.
最后验证: 2026-09-18 · 分类: 文件与文件夹