【msys2】「unzip」コマンドを使う

スポンサーリンク

msys2で.zipファイルの解凍をする「unzip」コマンドを使えるようにしたので備忘録を残す。

msys2でWindows上でのビルド環境をつくる(msys2のインストール)
GNU makeやコンパイラが動かせる環境を、Windows上にmsys2をインストールしてつくる。 Unixのbashライクなコマンドラインが使えるようになるソフトだが、このようなソフトは、他にはCygwinやMinGWなどがある。msy...

unzipコマンドのインストール

msys2ターミナルから、下記コマンドでインストール。

$ pacman -S unzip

起動確認

コマンド実行してみる。

$ unzip
UnZip 6.00 of 20 April 2009, by Info-ZIP.  Maintained by C. Spieler.  Send
bug reports using http://www.info-zip.org/zip-bug.html; see README for details.

Usage: unzip [-Z] [-opts[modifiers]] file[.zip] [list] [-x xlist] [-d exdir]
  Default action is to extract files in list, except those in xlist, to exdir;
  file[.zip] may be a wildcard.  -Z => ZipInfo mode ("unzip -Z" for usage).

  -p  extract files to pipe, no messages     -l  list files (short format)
  -f  freshen existing files, create none    -t  test compressed archive data
  -u  update files, create if necessary      -z  display archive comment only
  -v  list verbosely/show version info       -T  timestamp archive to latest
  -x  exclude files that follow (in xlist)   -d  extract files into exdir
modifiers:
  -n  never overwrite existing files         -q  quiet mode (-qq => quieter)
  -o  overwrite files WITHOUT prompting      -a  auto-convert any text files
  -j  junk paths (do not make directories)   -aa treat ALL files as text
  -U  use escapes for all non-ASCII Unicode  -UU ignore any Unicode fields
  -C  match filenames case-insensitively     -L  make (some) names lowercase
  -X  restore UID/GID info                   -V  retain VMS version numbers
  -K  keep setuid/setgid/tacky permissions   -M  pipe through "more" pager
See "unzip -hh" or unzip.txt for more help.  Examples:
  unzip data1 -x joe   => extract all files except joe from zipfile data1.zip
  unzip -p foo | more  => send contents of foo.zip via pipe into program more
  unzip -fo foo ReadMe => quietly replace existing ReadMe if archive file newer

使用例

$ unzip sample.zip

補足

7zコマンドを使っても、.zipファイルの解凍は行える。

$ 7z x <zipfile>
7-zip圧縮操作「7z」コマンドを使う
7zip圧縮ファイルを操作する「7z」コマンドを使えるようにしたので、備忘録を残す。 1.macOS Homebrewで下記コマンドでインストール $ brew install p7zip 2.msys2(Windows) pacman -...

関連記事

【msys2】パッケージ名を検索してインストールする
以前の記事で、msys2のコンソールシェル環境をインストールした。 msys2で利用できるパッケージが、msys2サイトから検索できるようになっていたので、検索方法について備忘録を残す。 msys2パッケージの検索 以下のサイトにアクセス。...

コメント

タイトルとURLをコピーしました