或者可从下载 RAR for Linux 编译安装 # tar -xzpvf rarlinux-3.8.0.tar.gz # cd rar # make 这样就安装好了,安装之后就有了rar和unrar这两个程序,rar是压缩程序,unrar是解压程序。它们的参数选项很多,可用命令rar -help和unrar -help查看,这里亦简单举例说明一下其用法:
# rar a yajiu.rar yajiu.jpg yajiu.png 这条命令是将yajiu.jpg和yajiu.png压缩成一个rar包 # rar a yajiu.rar *.jpg 这条命令是将所有.jpg的文件压缩成一个rar包 # rar a yajiu.rar yajiu 这条命令是将文件夹yajiu压缩成一个rar包 # unrar e yajiu.rar 这条命令是将yajiu.rar中的所有文件解压出来
yajiu@yajiu-desktop:~$ cd 图片 yajiu@yajiu-desktop:~/图片$ rar a yajiu.rar yajiu.jpg yajiu.png
RAR 3.80 beta 2 Copyright (c) 1993-2008 Alexander Roshal 16 Jun 2008 Shareware version Type RAR -? for help
Evaluation copy. Please register.
Creating archive yajiu.rar
Adding yajiu.jpg OK Adding yajiu.png OK Done yajiu@yajiu-desktop:~/图片$ rar a yajiu.rar *.jpg
RAR 3.80 beta 2 Copyright (c) 1993-2008 Alexander Roshal 16 Jun 2008 Shareware version Type RAR -? for help
Evaluation copy. Please register.
Creating archive yajiu.rar
Adding 1.jpg OK Adding 2.jpg OK Done yajiu@yajiu-desktop:~/图片$ rar a yajiu.rar yajiu
RAR 3.80 beta 2 Copyright (c) 1993-2008 Alexander Roshal 16 Jun 2008 Shareware version Type RAR -? for help
Evaluation copy. Please register.
Creating archive yajiu.rar
Adding yajiu/yajiu.zip OK Adding yajiu/yajiu.jpg OK Adding yajiu/yajiu.rar OK Adding yajiu/yajiu.7z OK Adding yajiu/yajiu.png OK Adding yajiu OK Done yajiu@yajiu-desktop:~/图片$ unrar e yajiu.rar
UNRAR 3.80 beta 2 freeware Copyright (c) 1993-2008 Alexander Roshal
Extracting from yajiu.rar
1.jpg already exists. Overwrite it ? [Y]es, [N]o, [A]ll, n[E]ver, [R]ename, [Q]uit Y
Extracting 1.jpg OK
7a008fc287fe680c0ff477e9.jpg already exists. Overwrite it ? [Y]es, [N]o, [A]ll, n[E]ver, [R]ename, [Q]uit Y
Extracting 2.jpg OK All OK yajiu@yajiu-desktop:~/图片$