Extracting Rar Files From the Command Line in Linux, Unix or Mac OSX

Unrar is a really useful command line utility for extracting rar files. On Mac OSX there are a couple of gui applications that will allow you to extract rar files such as unrarX. However if you want to extract a lot of rar files in multiple parts quickly, the unrar command line tool is the best way to do it.

Install unrar using MacPorts if you are on Mac OSX or use a package manager for your unix/linux distribution.

To extract a single file in the current directory:

unrar e file.rar

To list files in the rar file:

unrar l file.rar

If the rar file has a password, it will prompt you, or you can specify it on the command line:

unrar e -pPASSWORD file.rar

If you have a lot of rar files in different parts with the same password, you can extract them all with one command:

find . -type f -name "*.part1.rar" -exec unrar e -pPASSWORD {} \;

Extracting rar files this way works very well in conjunction with using wget to download lots of files.

Share and Enjoy:
  • Print
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google Bookmarks

About Greg Freeman

Read more about me on the About Greg Freeman page or twitter.
This entry was posted in Web and tagged , , , . Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

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