Wednesday, December 22, 2010

RAR in Linux

RAR is a very popular compression format in Windows (at least, since I am using Windows at work & at home). RAR generally has a better compression ratio than ZIP, and in places where disk space counts, would be cost-saving and "life-saving".

At my workplace, there's a need to Un-RAR a RAR file (created in Windows) in a Linux box. In the standard build of Linux (based on RHEL4) that we were running, the "unrar" command-line program is not present. Fortunately there's a free version on the Internet. Just need to do a little searching to get the RPM.

So I went to http://rpm.pbone.net/ and I found the right RPM file. My exact search result: http://rpm.pbone.net/index.php3/stat/4/idpl/11979708/dir/redhat_el_4/com/unrar-3.7.8-1.el4.rf.i386.rpm.html

Installing it is a breeze (phew!), with all the dependencies fulfilled in my Linux box. The command is simple (recommended using root-access to run):

rpm -i unrar-3.7.8-1.el4.rf.i386.rpm

So now, we can un-RAR files in Linux!

Basic usage:

unrar x myrarfile.rar

where 'x' is to extract files. Full list of options can be obtained by just typing "unrar".

What about creating RAR files in Linux? AFAIK, there's no free tool, but you can purchase or try one. Go get the files @ http://www.rarlabs.com

No comments: