11 08 2010
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:
1 |
unrar e file.rar |
To list files in the rar file:
1 |
unrar l file.rar |
If the rar file has a password, it will prompt you, or you can specify it on the command line:
1 |
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:
1 |
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.
Downloading Files From Command Line Using wget Setup Local Web Development Environment on Mac
Hello,
Kindly explain the last command on this page in brief.
Other all the commands are a very good help.
Thank you.
Yupie….
great! good clear article (but unrar is not installed on default..)
Thank You!