はじめに
Macでは、標準でRARファイルを解凍することができません。そこでこの記事ではunrar
をインストールして、それを用いて解凍する方法を説明します。
こちらの環境は以下の通りです。
- macOS Big Sur 11.2.3 (Intel)
- Homebrew 3.1.3-52-g813f751-dirty
- UNRAR 6.01
unrar
のインストール
以下の記事にあるとおり、brew install unrar
では現在インストールできないため、次のようにします。
$ brew install carlocab/personal/unrar
解凍
使い方はunrar
と叩いて出てくる説明を読めば良いですが、ここでは主なコマンドを説明します。
-
unrar x example.rar
: ディレクトリ構造を保持したままexample.rarを解凍します。基本的にこれを使っておけばよいと思います。 -
unrar e example.rar
: ディレクトリ構造を保持せずexample.rarを解凍します。もし同じ名前のファイルが別ディレクトリにある場合、上書きしても良いか聞かれます。
UNRAR 6.01 freeware Copyright (c) 1993-2021 Alexander Roshal
Usage: unrar <command> -<switch 1> -<switch N> <archive> <files...>
<@listfiles...> <path_to_extract\>
<Commands>
e Extract files without archived paths
l[t[a],b] List archive contents [technical[all], bare]
p Print file to stdout
t Test archive files
v[t[a],b] Verbosely list archive contents [technical[all],bare]
x Extract files with full path
(以下略)