linux-command/command/7z.md

49 lines
824 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

7z
===
拥有极高压缩比的开源压缩软件。
## 安装
在 Linux 中输入以下命令安装 7-Zip。
```bash
# Ubuntu 系统
apt-get update
apt-get install p7zip-full -y
```
## 实例
介绍几个常用场景:解压、压缩、查看(压缩包内容)。
1、将压缩文件 text.7z 在当前目录下解压缩。
```bash
7z x text.7z
```
2、将压缩文件 text.7z 在指定目录(/home/text)下解压缩。
```bash
# 注意 -o 用来指定解压缩文件存放目录,-o 后是没有空格的,直接接目录
7z x text.7z -r -o/home/text
```
3、将文件 /home/text 压缩成 text.7z。
```bash
7z a text.7z -r /home/text
```
4、查看压缩包 text.7z 内容,但不解压。
```bash
7z l text.7z
```
## 官网
更多安装使用方法可以访问官网学习https://www.7-zip.org/