2023-02-19

Unzipping RAR Files on Mac with Command Line Using Unrar

Introduction

Unlike some other operating systems, Mac OS doesn't natively support RAR file decompression. This article introduces a reliable way to decompress RAR files on a Mac using the command line with a utility called unrar.

Installing unrar on Mac

You can use the following Homebrew command to install unrar:

bash
$ brew install carlocab/personal/unrar

Unzipping RAR Files

Upon successfully installing unrar, you can utilize it to unzip RAR files.

unrar x

The unrar x command is an effective method to extract the contents of a RAR file while preserving the original directory structure. If you want to maintain the exact organization of folders and files as they were initially compressed, this command should be your go-to choice.

To use this command, simply type:

bash
$ unrar x example.rar

This command instructs unrar to extract all contents of example.rar, maintaining the directory structure.

unrar e

In contrast to the unrar x command, the unrar e command extracts all files from the RAR archive directly to your current working directory, regardless of their original directory path in the archive.

$ unrar e example.rar

This command will extract all the files contained in example.rar, but unlike unrar x, it does not preserve the original directory structure.

One important thing to note when using unrar e is that if there are files with identical names in different directories within the RAR file, you might be prompted to overwrite files during the extraction process. This behavior might not be desirable in all situations, so it's something to be aware of when choosing which command to use.

Ryusei Kakujo

researchgatelinkedingithub

Focusing on data science for mobility

Bench Press 100kg!