Decompressing *.RAR on a Mac OS X can’t be done by default. Of course you could use UnRarX to do this job, though not my cup of tea. I like command-line utilities e.g. par2cmdline and unrar. This post will help you installing the freeware unrar command-line tool from Rarlab.
Download the full package containing both rar (shareware) and unrar (freeware) from the Rarlab website. I’ve chosen the RAR 3.70 for Mac OS X package (rarosx-126.96.36.199.tar.gz). Decompress the package (just double click on the .tar.gz file) and you will see a new folder, named rar, containing the necessary files.
Enter your terminal, which can be found in /Applications/Utilities.
Start up Terminal on your Mac, located in /Applications/Utilities
Go to the newly created rar folder with both rar and unrar. You can use the command cd to change directories.
Use the following command to install unrar:
~$: sudo install -c -o $USER unrar /bin
$USER is a default environment variable in the bash shell which contains your username.
Sudo requires you to enter your user password. It’s the same password you use when you log in to Mac OS X. To install rar you can use the same command:
~$: sudo install -c -o $USER rar /bin
Do a test-run to see if the installation went properly. In your terminal now enter from any location you want:
When unrar is properly installed, usage information should appear explaining commands and switches you can use. To decompress a .RAR package simply use the following command which will extract all files with full path:
~$: unrar x compressed-package.rar
In your terminal it will look like this:
That’s it! Have fun decompressing .RAR archives on your Mac using cool command lines.