Handle RAR and UNRAR through Command lines (Terminal) in Mac OS X without archiver softwares

#1

Mac OS X does not support file.rar by default. Normally, to extract a file.rar or compress a file into File.Rar, mac users need to use an archiver softwares which costs money for the license.

Look at our very specific tutorial today to handle RAR and UNRAR through single and absolutely FREE command lines using terminal in MacOS: Mojave, High Sierra, Sierra, Mavericks, Yosemite and El Capitan,….

I, Download and Install latest RAR for MacOS

How to locate “/usr/local/bin”?
From menu Finder, Go -> Go to Folder -> “/usr/local/bin”.

rar and unrar command line is now available.

II, How to UnRar using Command Line in Terminal?
Using the following command line form, you can Unrar any files.rar in your Mac OS X without using any archiver softwares.

unrar x /path/to/filename.rar -d /patch/to/folder

/path/to/ is the direction of the targeted file.rar. and the folder you want to extract the file into.

For example, I have test.rar under this direction: unrar x /users/phanhongquan/desktop/appledigg/test.rar

I am able to unrar the file by the following command line.

unrar x /users/phanhongquan/desktop/appledigg/test.rar -d /users/phanhongquan/desktop/appledigg/

Otherwise, you can type "unrar x " (including a space), then drag and drop the targeted file.rar into terminal window.

The file.rar will be extracted into /users/your user name/ by default.

Notification: If the unrar command line does not work, you can install unrar thourgh HomeBrew by the following command line:

brew install unrar

Cheers!
[1]: http://www.rarlab.com/download.htm

2 Likes

Tips to compress (Rar, Zip) files on Mac with Password protection
pinned globally #2
0 Likes

#3

This is awesome. Thank for your share :ribbon:

0 Likes

unpinned #4
0 Likes

pinned #5
0 Likes

#6

when i make sudo mkdir -p /usr/local/bin (because i have OS el capitan) i recieve a message not a directory

0 Likes

#7

Hello,

I followed the instructions to get winrar to work on a mac using the terminal. I was able to get both the rar and unrar command lines to work, but at some point when I try to use unrar I get the following:

Would you like to replace the existing file /Users/Bart/Documents/.DS_Store
18436 bytes, modified on 2016-06-28 01:02
with a new one
18436 bytes, modified on 2016-06-28 01:00

[Y]es, [N]o, [A]ll, n[E]ver, [R]ename, [Q]uit e

The .DS_Store is not part of the file extension that I want to unzip, and whatever I select in terms of options the .rar file is not unzipped. It also asks me to replace some other files, most of which come from the rar folder that I downloaded from WinRAR. Any help with this would be appreciated.

0 Likes

#8

It’s would be much easy for me if you can take a screenshot.

0 Likes

#11

It’s now simply buy just copy the following 4 files default.sfx, rar, rarfiles.lst, unrar into /usr/local/bin/

0 Likes