LoginSignup
19
3

More than 3 years have passed since last update.

MacでRARファイルをコマンドラインで解凍する(unrar)

Last updated at Posted at 2021-04-23

はじめに

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

(以下略)
19
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
19
3