一、安装 7z 工具
不同发行版安装方式不一样:
Ubuntu / Debian
sudo apt update
sudo apt install -y p7zip-full
CentOS / Fedora
sudo yum install -y p7zip p7zip-plugins
Arch Linux
sudo pacman -S p7zip
二、解压 .7z 文件
普通解压到当前目录:
7z x file.7z
解压到指定目录:
7z x file.7z -o/path/to/dir
(注意 -o 后面不能有空格)
查看压缩包内容:
7z l file.7z
三、其他常用命令
压缩文件:
7z a archive.7z file1 file2 dir/
测试压缩包完整性:
7z t file.7z
评论区