超简单:Linux安装rar/unrar工具与解压到目录示例

1、下载rar软件包

[root@node1 ~]# tar -zxvf rarlinux-x64-5.3.0.tar.gz
rar/
rar/order.htm
rar/acknow.txt
rar/readme.txt
rar/rar_static
rar/default.sfx
rar/license.txt
rar/rarfiles.lst
rar/whatsnew.txt
rar/makefile
rar/rar
rar/unrar
rar/rar.txt
[root@node1 ~]#

2、编译安装

[root@node1 ~]# cd rar
[root@node1 rar]# ll
total 2520
-rw-r--r-- 1 1000 1000    4188 Nov 18  2015 acknow.txt
-rwxr-xr-x 1 1000 1000  179232 Nov 18  2015 default.sfx
-rw-r--r-- 1 1000 1000    6753 Nov 18  2015 license.txt
-rw-r--r-- 1 1000 1000     428 Nov 18  2015 makefile
-rw-r--r-- 1 1000 1000    3144 Nov 18  2015 order.htm
-rwxr-xr-x 1 1000 1000  533488 Nov 18  2015 rar
-rw-r--r-- 1 1000 1000    1154 Nov 18  2015 rarfiles.lst
-rwxr-xr-x 1 1000 1000 1404512 Nov 18  2015 rar_static
-rw-r--r-- 1 1000 1000   98599 Nov 18  2015 rar.txt
-rw-r--r-- 1 1000 1000     782 Nov 18  2015 readme.txt
-rwxr-xr-x 1 1000 1000  299192 Nov 18  2015 unrar
-rw-r--r-- 1 1000 1000   16537 Nov 18  2015 whatsnew.txt
[root@node1 rar]# make
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
[root@node1 rar]#

3、unrar解压示例

[root@node1 ~]# unrar x /data/download/test/21/70号.rar /data/download/test/21/70号

UNRAR 5.30 freeware      Copyright (c) 1993-2015 Alexander Roshal


Extracting from /data/download/test/21/70号.rar

Extracting  /data/download/test/21/70号/70号.pdf   OK 
Extracting  /data/download/test/21/70号/70号附件1.pdf  OK 
Extracting  /data/download/test/21/70号/70号附件2.pdf  OK 
Extracting  /data/download/test/21/70号/70号附件3.pdf  OK 
Extracting  /data/download/test/21/70号/70号附件4.pdf  OK 
All OK
[root@node1 ~]#
[root@node1 ~]# ll /data/download/test/21/70号
total 1532
-rw-r--r-- 1 root root      0 Apr 17 23:06 1523977602299.txt
-rw-r--r-- 1 root root      0 Apr 18 09:35 1524015332935.txt
-rw-r--r-- 1 root root      0 Apr 18 13:45 1524030329498.txt
-rw-r--r-- 1 root root 117046 Aug 11  2015 70号.pdf
-rw-r--r-- 1 root root 502444 Aug 11  2015 70号附件1.pdf
-rw-r--r-- 1 root root 282322 Aug 11  2015 70号附件2.pdf
-rw-r--r-- 1 root root 337656 Aug 11  2015 70号附件3.pdf
-rw-r--r-- 1 root root 321632 Aug 11  2015 70号附件4.pdf
[root@node1 ~]# 

你可能感兴趣的:(Linux)