Extract rar files in Linux

15 Aug, 2007  |  Posted by Danesh  |  in Linux

RAR is a proprietary compression format widely used today. It’s supposedly has 30% higher compression rate when compared with WinZip. If you download large torrent then chances are you are are already well acquainted with RAR.

I use RAR on my Windows and Linux boxes everyday and today I’ll show you how to extract RAR files from the Linux command line.

In Linux, to extract a RAR file you would use the unrar command. The unrar binaries are typically not included with the default Linux install so you will have to install them either through the package manager or by downloading binaries from rarlab.com

Let’s get to the HowTo now,

Extract a RAR file into the curren directory.

# unrar e [filename].rar

Extract a RAR file with the full file path.

# unrar x [filename].rar

List contents of a RAR file

# unrar l [filename].rar

Test intergruty of a RAR file

# unrar t [filename].rar

If you face any problems obtaining,installing or using unrar please contact me. I will be glad to help.

  • Digg
  • del.icio.us
  • BlinkList
  • Reddit
  • Slashdot
  • StumbleUpon
  • Technorati
  • Furl
  • Google
  • Live
  • Facebook
  • Pownce
  • TwitThis
  • E-mail this story to a friend!
  • LinkedIn
  • Ping.fm
Tags: ,

16 Responses so far | Have Your Say!

  1. vijay  |  September 4th, 2007 at 8:05 pm #

    Hi
    Thanks for providing unrar command ,i have benn searching for this for the past 2 hours.

    vijay

    vijay - Gravatar
  2. Danny  |  September 4th, 2007 at 8:11 pm #

    no problem vijay. glad to help

    Danny - Gravatar
  3. vijay  |  September 5th, 2007 at 4:48 pm #

    Hi

    Can u please provide me site to download WINrar wch should support RedHat Linux(2.6.9)

    Regards
    vijay

    vijay - Gravatar
  4. Danny  |  September 5th, 2007 at 10:41 pm #

    Danny - Gravatar
  5. Tom McManus  |  September 25th, 2007 at 4:57 am #

    Hello — I have about 20 parts to a larger file. I am having trouble figuring out how to unrar these files. They are VMWare images and one file could span mulitple rar file. Any help would be great. Thanks, Tom

    Tom McManus - Gravatar
  6. Tom McManus  |  September 25th, 2007 at 7:05 am #

    Please ignore my post. Extracting the first part correctly extracted the other 20 parts.
    Thanks,
    Tom

    Tom McManus - Gravatar
  7. Danny  |  September 26th, 2007 at 4:21 pm #

    Good to hear you got it working Tom

    Danny - Gravatar
  8. somesh  |  September 28th, 2007 at 12:13 am #

    rar: /lib/tls/libc.so.6: version `GLIBC_2.4′ not found (required by rar)

    I got the above error when i used ‘rarlinux-3.71.b1.tar.gz’ from the link which you had mentioned.
    How do I fix it to extract a rar file in RHLinux

    somesh - Gravatar
  9. Danny  |  September 28th, 2007 at 3:57 pm #

    Somesh, your GNU C library needs to be updated.

    Goto http://rpm.pbone.net/ and search for “GLIBC_2.4″. You should be able to find a suitable rpm package there.

    Danny - Gravatar
  10. somesh  |  October 4th, 2007 at 12:56 am #

    hi danny,
    Thanks for the link, i recently upgraded to rhel 5, and things worked even without the rpm package, maybe it got upgraded in the process.
    Just one small correction, i found we need not give the hyphen before the ‘e’ option for unrar’ing the rar file…

    somesh - Gravatar
  11. Danny  |  October 4th, 2007 at 10:45 am #

    Hi Somesh, Good to hear everything is working fine for you now. Thanks for the hyphen update. (I’m so used to using hyphens of options ;))

    Anyways, hope to hear from you soon and make sure to check back often.

    Danny - Gravatar
  12. Graphs  |  October 13th, 2007 at 6:57 pm #

    At a GNU bash, version 3.00.16(1)-release (i386-redhat-linux-gnu)
    I found that
    $ rar e [filename].rar target/
    (the e without hyphen) works just as wel.

    Graphs - Gravatar
  13. shoumadi das  |  December 11th, 2007 at 12:23 pm #

    when i am entering the command unrar e filename.rar some bash command is coming telling bash:unrar:command not found.I am using redhat linux.Please suggest.

    shoumadi das - Gravatar
  14. Danny  |  December 11th, 2007 at 7:52 pm #

    Hi Das, I think you don’t have the unrar package installed.

    If you go through the comments you will find the download location for the unrar package.

    Hope this helps

    Danny - Gravatar
  15. Alex Krenvalk  |  January 27th, 2008 at 12:02 am #

    I know program is working with RAR files in Windows, and possble in Linux-rar fixer, do something tool was specifically developed for extracting information from corrupted archives of the RAR format, works with all variants of this format and can recover data from archives and corrupt rar files with various compression rates and created in different software, it allows you to recover information from corrupt archives and corrupt rar files stored on removable media or on remote computers (tool can fix rar file via the local area network).

    Alex Krenvalk - Gravatar
  16. Dolf  |  August 28th, 2008 at 11:08 pm #

    rar: /lib/tls/libc.so.6: version `GLIBC_2.4′ not found (required by rar)

    I couldn’t fix the library problem, but I found a workaround.
    In the distribution is also an executable called “rar_static” simply use that instead of rar…

    Cheers, Dolf

    Dolf - Gravatar

Leave a Feedback

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>