
在 Linux 系统中,7z 是一款高效支持多种格式的压缩与解压实用程序。
作为开源压缩工具,7z 利用 LZMA 和 LZMA2 压缩算法,在保证高压缩率的同时提供灵活的功能。其兼容性广泛,可处理如下格式:
.7z(默认格式).zip.gzip.bzip2.tar 等常见类型多数 Linux 发行版通过 p7zip 包提供该工具:
# Ubuntu/Debian
sudo apt install p7zip-full
<h1>CentOS/RHEL</h1><p>sudo yum install p7zip</p>
<div class="aritcle_card">
<a class="aritcle_card_img" href="/ai/1319">
<img src="https://img.php.cn/upload/ai_manual/000/000/000/175680201295703.jpg" alt="AI Undetect">
</a>
<div class="aritcle_card_info">
<a href="/ai/1319">AI Undetect</a>
<p>让AI无法察觉,让文字更人性化,为文字体验创造无限可能。</p>
<div class="">
<img src="/static/images/card_xiazai.png" alt="AI Undetect">
<span>162</span>
</div>
</div>
<a href="/ai/1319" class="aritcle_card_btn">
<span>查看详情</span>
<img src="/static/images/cardxiayige-3.png" alt="AI Undetect">
</a>
</div>
<h1>Arch Linux</h1><p>sudo pacman -S p7zip安装验证方式:
7z --version
7z <command> [参数] <归档文件名> [目标文件...]</command>
核心指令一览
| 指令 | 功能描述 |
|---|---|
a |
将文件添加至压缩包 |
e |
快速解压(忽略路径结构) |
x |
完整解压(保留原始路径) |
l |
查看压缩包内容列表 |
d |
移除压缩包内指定文件 |
t |
校验压缩包完整性 |
7z a archive.7z file1.txt file2.txt # 压缩多个文件 7z a archive.7z dir/ # 打包整个目录 7z a -tzip archive.zip file.txt # 生成 ZIP 格式 7z a -p123456 archive.7z file.txt # 使用密码加密压缩
7z x archive.7z # 当前路径解压 7z x archive.7z -o/path/to/extract # 指定解压位置 7z x -p123456 archive.7z # 解密压缩包
7z l archive.7z
7z d archive.7z file_to_remove.txt
7z t archive.7z
7z a -v100M archive.7z large_file.dat # 拆分压缩为 100MB 单元
还原时只需定位首个分卷:
7z x archive.7z.001
以上就是linux高效的多格式压缩与解压工具是什么-7z 命令使用与实例的详细内容,更多请关注php中文网其它相关文章!
每个人都需要一台速度更快、更稳定的 PC。随着时间的推移,垃圾文件、旧注册表数据和不必要的后台进程会占用资源并降低性能。幸运的是,许多工具可以让 Windows 保持平稳运行。
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号