3
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

macでzipファイルを解凍するときに使うコマンド

Last updated at Posted at 2024-01-24

この記事は何?

mac環境にて zipファイルを解凍するためのコマンドのメモです。
以下の3種類紹介します。

  • unzip
  • ditto
  • 7z

unzip

基本形式

unzip [ファイル名.zip]

# パスワード付きの場合
unzip -P [パスワード] [ファイル名.zip]

unzip archive.zip

パスワード付きの場合

unzip -P Password archive.zip

ditto

基本形式

ditto -V -x -k --sequesterRsrc --rsrc [ファイル名.zip] [出力先ディレクトリ]

# パスワード付きの場合
ditto -V -x -k --sequesterRsrc --password --rsrc [ファイル名.zip] [出力先ディレクトリ]

ditto -V -x -k --sequesterRsrc --rsrc archive.zip .

パスワード付きの場合: コマンド実行後にパスワードを入力します。

ditto -V -x -k --sequesterRsrc --password --rsrc archive.zip .

7z

インストール

brew install p7zip

基本形式

7z x "[ファイル名.zip]" -o"[出力先ディレクトリ]"

# パスワード付きの場合
7z x -p[パスワード] "[ファイル名.zip]" -o"[出力先ディレクトリ]"

7z x archive.zip -o"."

パスワード付きの場合

7z x -pPassword archive.zip -o"."

最後に

unzipだけで十分だと思ったら開けないファイルがあり、結局3種類使い分ける羽目になりました。どれか使えば開けるはず...。

3
1
2

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
3
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?