云服务器 99 / 年,新老同享(可以99/年续费),开发者力荐特惠渠道,新客户在享受9折
阿里云推广

linux 安装rar解压工具

  • 内容
  • 评论
  • 相关

linux中默认的tar命令用于解压压缩文件,但是tar命令不支持rar文件的解压和压缩,需要安装rar解压工具,实现rar命令解压rar压缩包。

1.下载rarlab软件

官网下载页面:https://www.rarlab.com/download.htm
rar工具软件下载地址(RAR 5.50 for Linux x64):https://www.rarlab.com/rar/rarlinux-x64-5.5.0.tar.gz


[root@wlphp test]# wget  https://www.rarlab.com/rar/rarlinux-x64-5.5.0.tar.gz
--2018-10-04 13:15:35--  https://www.rarlab.com/rar/rarlinux-x64-5.5.0.tar.gz
Resolving www.rarlab.com (www.rarlab.com)... 5.135.104.98
Connecting to www.rarlab.com (www.rarlab.com)|5.135.104.98|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 536028 (523K) [application/x-gzip]
Saving to: ‘rarlinux-x64-5.5.0.tar.gz’

100%[=============================================================>] 536,028     40.6KB/s   in 14s    

2018-10-04 13:15:55 (38.6 KB/s) - ‘rarlinux-x64-5.5.0.tar.gz’ saved [536028/536028]

2.解压和安装rar工具
[root@wlphp test]# tar -xzvf rarlinux-x64-5.5.0.tar.gz
rar/
rar/order.htm
rar/acknow.txt
rar/readme.txt
rar/default.sfx
rar/license.txt
rar/rarfiles.lst
rar/whatsnew.txt
rar/makefile
rar/rar
rar/unrar
rar/rar.txt
[root@wlphp test]# ls
frp_0.20.0_linux_amd64  rar  rarlinux-x64-5.5.0.tar.gz  test
[root@wlphp test]# cd  rar
[root@wlphp rar]# ls
acknow.txt   license.txt  order.htm  rarfiles.lst  readme.txt  whatsnew.txt
default.sfx  makefile     rar        rar.txt       unrar
[root@wlphp rar]# make && make install
mkdir -p /usr/local/bin
mkdir -p /usr/local/lib
cp rar unrar /usr/local/bin
cp rarfiles.lst /etc
cp default.sfx /usr/local/lib
mkdir -p /usr/local/bin
mkdir -p /usr/local/lib
cp rar unrar /usr/local/bin
cp rarfiles.lst /etc
cp default.sfx /usr/local/lib
3.使用 rar压缩 unrar解压文件
[root@wlphp test]# rar a all *

RAR 5.50   Copyright (c) 1993-2017 Alexander Roshal   11 Aug 2017
Trial version             Type 'rar -?' for help

Evaluation copy. Please register.

Creating archive all.rar

Adding    1.txt                                                       OK 
Adding    2.txt                                                       OK 
Adding    3.txt                                                       OK 
Done
[root@wlphp test]# ls
1.txt  2.txt  3.txt  all.rar
[root@wlphp test]# rm 1.txt 2.txt 3.txt
rm: remove regular file ‘1.txt’? y
rm: remove regular file ‘2.txt’? y
rm: remove regular file ‘3.txt’? y
[root@wlphp test]# ls
all.rar
[root@wlphp test]# unrar e all.rar 

UNRAR 5.50 freeware      Copyright (c) 1993-2017 Alexander Roshal


Extracting from all.rar

Extracting  1.txt                                                     OK 
Extracting  2.txt                                                     OK 
Extracting  3.txt                                                     OK 
All OK
[root@wlphp test]# ls
1.txt  2.txt  3.txt  all.rar


本文标签:

版权声明:若无特殊注明,本文皆为《菜鸟站长》原创,转载请保留文章出处。

本文链接:linux 安装rar解压工具 - https://wlphp.com/?post=168

发表评论

电子邮件地址不会被公开。 必填项已用*标注