====== unzip ====== 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 === アーカイブ内の詳細確認(-l) === $ 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 === アーカイブ内の詳細確認(-Z) === $ 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.