この文書の現在のバージョンと選択したバージョンの差分を表示します。
02_freebsd:80_unixコマンド:unzip [2014/05/09 11:22] matsui 作成 |
02_freebsd:80_unixコマンド:unzip [2014/05/09 11:22] (現在) matsui [オプション] |
||
---|---|---|---|
ライン 1: | ライン 1: | ||
+ | ====== unzip ====== | ||
+ | unzip コマンドは、ZIP 形式のアーカイブを伸長 (解凍)・展開することができる。 | ||
+ | |||
+ | |||
+ | ===== オプション ===== | ||
+ | |||
+ | |-l|ファイル一覧を表示| | ||
+ | |-Z|-l よりも詳細なファイル一覧表示| | ||
+ | |-p|ファイル内容を標準出力に出力する| | ||
+ | |-o|既に展開済みのファイルが存在しても強制上書き| | ||
+ | |-f|既に展開済みのファイルについて、zip アーカイブ内により新しいファイルが存在した場合のみ、上書きする。 \\ 展開済みでないファイルはスキップされる| | ||
+ | |-n|既に展開済みのファイルはスキップし、まだ展開されていないファイルのみ展開| | ||
+ | |-t|zip ファイルの展開テストを行い、破損していないことを確認する。| | ||
+ | |||
+ | |||
+ | ===== コマンド例 ===== | ||
+ | |||
+ | === アーカイブ解凍 === | ||
+ | <code console> | ||
+ | $ unzip test.zip | ||
+ | Archive: test.zip | ||
+ | extracting: a.txt | ||
+ | extracting: b.txt | ||
+ | extracting: c.txt | ||
+ | </code> | ||
+ | |||
+ | === アーカイブ内の詳細確認(-l) === | ||
+ | <code console> | ||
+ | $ 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 | ||
+ | </code> | ||
+ | |||
+ | === アーカイブ内の詳細確認(-Z) === | ||
+ | |||
+ | <code console> | ||
+ | $ 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% | ||
+ | </code> | ||
+ | |||
+ | |||
+ | === 破損がないか確認 === | ||
+ | |||
+ | <code console> | ||
+ | $ 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. | ||
+ | </code> |