unzip コマンドは、ZIP 形式のアーカイブを伸長 (解凍)・展開することができる。
| -l | ファイル一覧を表示 |
| -Z | -l よりも詳細なファイル一覧表示 |
| -p | ファイル内容を標準出力に出力する |
| -o | 既に展開済みのファイルが存在しても強制上書き |
| -f | 既に展開済みのファイルについて、zip アーカイブ内により新しいファイルが存在した場合のみ、上書きする。 展開済みでないファイルはスキップされる |
| -n | 既に展開済みのファイルはスキップし、まだ展開されていないファイルのみ展開 |
| -t | zip ファイルの展開テストを行い、破損していないことを確認する。 |
$ unzip test.zip Archive: test.zip extracting: a.txt extracting: b.txt extracting: c.txt
$ unzip -l test.zip
Archive: test.zip
Length Date Time Name
-------- ---- ---- ----
4 05-09-14 11:10 a.txt
4 05-09-14 11:10 b.txt
4 05-09-14 11:10 c.txt
-------- -------
12 3 files
$ unzip -Z test.zip Archive: test.zip 394 bytes 3 files -rw-rw-r-- 2.3 unx 4 tx stor 9-May-14 11:10 a.txt -rw-rw-r-- 2.3 unx 4 tx stor 9-May-14 11:10 b.txt -rw-rw-r-- 2.3 unx 4 tx stor 9-May-14 11:10 c.txt 3 files, 12 bytes uncompressed, 12 bytes compressed: 0.0%
$ unzip -t test.zip
Archive: test.zip
testing: a.txt OK
testing: b.txt OK
testing: c.txt OK
No errors detected in compressed data of test.zip.