Linux本身不支持unrar和rar命令,需要我们安装RAR for Linux
下载rar 软件
[root@localhost ~]# wget https://www.rarlab.com/rar/rarlinux-x64-5.9.0.tar.gz
2.安装
[root@iZf8ze76gcpdjr5dtx1l53Z ~]# tar xf rarlinux-x64-5.9.0.tar.gz
[root@iZf8ze76gcpdjr5dtx1l53Z ~]# cd rar/
[root@iZf8ze76gcpdjr5dtx1l53Z rar]# ls
acknow.txt license.txt order.htm rarfiles.lst readme.txt whatsnew.txt
default.sfx makefile rar rar.txt unrar
[root@iZf8ze76gcpdjr5dtx1l53Z rar]# make && make install
3.压缩和解压用法
压缩:rar a [不含.rar后缀的压缩包名字] [需要压缩的文件或者文件夹]
解压:rar x [rar的压缩包]
3.解压例子
#压缩
[root@iZf8ze76gcpdjr5dtx1l53Z ~]# rar a tmp.rar /tmp
#解压
[root@iZf8ze76gcpdjr5dtx1l53Z ~]# rar x tmp.rar