正常rar是windows下的压缩文件,linux是不支持的。但是可以通过安装rarlinux来使用rar命令解压rar文件。
首先下载rarlinux
[root@localhost ~]# wget http://rarsoft.com/rar/rarlinux-4.0.1.tar.gz--2015-07-17 22:59:37-- http://rarsoft.com/rar/rarlinux-4.0.1.tar.gzResolving rarsoft.com... 5.135.104.98Connecting to rarsoft.com|5.135.104.98|:80... connected.HTTP request sent, awaiting response... 200 OKLength: 860102 (840K) [application/x-gzip]Saving to: “rarlinux-4.0.1.tar.gz”100%[==========================================================>] 860,102 11.1K/s in 61s 2015-07-17 23:00:39 (13.8 KB/s) - “rarlinux-4.0.1.tar.gz” saved [860102/860102][root@localhost ~]# lsanaconda-ks.cfg install.log install.log.syslog rarlinux-4.0.1.tar.gz[root@localhost ~]# man mv[root@localhost ~]# mv rarlinux-4.0.1.tar.gz /home/xingoo/Downloads/[root@localhost ~]# cd /home/xingoo/Downloads/[root@localhost Downloads]# lsbxgzldmgsJavaScriptcxdjy(jb51..net).rar kibana-4.1.1-linux-x86.tar.gzbxgzldmgsJavaScriptcxdjy(jb51..net).rar.part libflashplayer.soelasticsearch-1.6.0.tar.gz.part Nodejxjy(jb51.net).rarinstall_flash_player_11_linux.i386.tar.gz NodeWebkf(jb51.net).rarJavaScriptjcjc(jb51.net).rar rarlinux-4.0.1.tar.gzkibana-4.1.1-linux-x86[root@localhost Downloads]# tar -zxvf rarlinux-4.0.1.tar.gz rar/rar/readme.txtrar/default.sfxrar/whatsnew.txtrar/license.txtrar/order.htmrar/rarrar/unrarrar/rar_staticrar/technote.txtrar/rarfiles.lstrar/makefilerar/rar.txt[root@localhost Downloads]# lsbxgzldmgsJavaScriptcxdjy(jb51..net).rar kibana-4.1.1-linux-x86.tar.gzbxgzldmgsJavaScriptcxdjy(jb51..net).rar.part libflashplayer.soelasticsearch-1.6.0.tar.gz.part Nodejxjy(jb51.net).rarinstall_flash_player_11_linux.i386.tar.gz NodeWebkf(jb51.net).rarJavaScriptjcjc(jb51.net).rar rarkibana-4.1.1-linux-x86 rarlinux-4.0.1.tar.gz[root@localhost Downloads]# cd rar[root@localhost rar]# lsdefault.sfx makefile rar rar_static readme.txt unrarlicense.txt order.htm rarfiles.lst rar.txt technote.txt whatsnew.txt[root@localhost rar]# makemkdir -p /usr/local/binmkdir -p /usr/local/libcp rar unrar /usr/local/bincp rarfiles.lst /etccp default.sfx /usr/local/lib[root@localhost rar]# man rar
按照上面的步骤,下载好rarlinux安装包、解压缩、进入文件夹执行make,就可以使用命令了。