2019-07-02 22:03:08 +08:00
|
|
|
# Linux 下压缩和解压 RAR 包
|
|
|
|
|
|
|
|
## 安装
|
|
|
|
|
2022-04-29 13:20:16 +08:00
|
|
|
安装指令如下:
|
2019-07-02 22:03:08 +08:00
|
|
|
|
2022-04-29 13:20:16 +08:00
|
|
|
```bash
|
2023-10-25 16:02:20 +08:00
|
|
|
# Ubuntu
|
2022-04-29 13:20:16 +08:00
|
|
|
sudo apt install rar unrar
|
2023-10-25 16:02:20 +08:00
|
|
|
# Ubuntu 20.04.6 LTS
|
|
|
|
sudo apt install unrar-free
|
|
|
|
# Manjaro
|
2022-04-29 13:20:16 +08:00
|
|
|
sudo pacman -S rar unrar
|
|
|
|
```
|
2019-07-02 22:03:08 +08:00
|
|
|
|
|
|
|
## 压缩
|
|
|
|
|
2022-04-29 13:20:16 +08:00
|
|
|
使用 rar 的 a 参数对多个文件或文件夹进行压缩如下:
|
2019-07-02 22:03:08 +08:00
|
|
|
|
2022-04-29 13:20:16 +08:00
|
|
|
```bash
|
|
|
|
rar a <rar package> <file1> <file2> ...
|
|
|
|
```
|
2019-07-02 22:03:08 +08:00
|
|
|
|
|
|
|
## 解压
|
|
|
|
|
2023-10-25 16:02:20 +08:00
|
|
|
使用 unara 的 e 或 x 参数对文件进行解压如下:
|
2019-07-02 22:03:08 +08:00
|
|
|
|
2022-04-29 13:20:16 +08:00
|
|
|
```bash
|
|
|
|
unrar e <rar package>
|
2023-10-25 16:02:20 +08:00
|
|
|
unrar x <rar package>
|
2022-04-29 13:20:16 +08:00
|
|
|
```
|