UNIX/Linuxの部屋 zipinfoコマンドの使い方

TOP UNIX/Linuxの部屋 UNIX/Linuxコマンド一覧 用語集 新版 由来/読み方辞書 環境変数マニュアル Cシェル変数 システム設定ファイル システムコール・ライブラリ ネットワークプログラミングの基礎知識 クラウドサービス徹底比較・徹底解説




コマンド zipinfo ZIP ファイル形式のアーカイブの情報を表示 このエントリーをはてなブックマークに追加

zipinfo コマンドは、ZIP アーカイブ内に含まれるファイルの情報を表示するためのコマンドである。あくまで表示のみであるため、伸長 (解凍) するには、unzip を使う。



zipinfo コマンドの基本的な使い方
zipinfo コマンドの実行例は下記のとおり。
% zipinfo example.zip
⇒ example.zip の内容を表示する。
Archive: exmaple.zip 42433 bytes 4 files
-rw-r--r-- 2.3 unx 64704 tx defN 19-Apr-09 00:39 sample1.txt
-rw-r--r-- 2.3 unx 23052 tx defN 19-Apr-09 00:39 sample2.txt
-rw-r--r-- 2.3 unx 94896 tx defN 19-Apr-09 00:40 sample3.txt
-rw-r--r-- 2.3 unx 13599 tx defN 19-Apr-09 00:40 sample4.dat
4 files, 196251 bytes uncompressed, 41883 bytes compressed: 78.7%

zipinfo コマンドのオプション
▷ -s … ls -l のような表示を出力する。
% zipinfo -s exmaple.zip
-rw-r--r-- 2.3 unx 64704 tx defN 19-Apr-09 00:39 sample1.txt
-rw-r--r-- 2.3 unx 23052 tx defN 19-Apr-09 00:39 sample2.txt
▷ -m … -s と似ているが、圧縮率を表示する。
% zipinfo -m exmaple.zip
-rw-r--r-- 2.3 unx 64704 tx 76% defN 19-Apr-09 00:39 sample1.txt
-rw-r--r-- 2.3 unx 23052 tx 71% defN 19-Apr-09 00:39 sample2.txt
▷ -l … -s と似ているが、圧縮後のファイルサイズを表示する。
% zipinfo -l exmaple.zip
-rw-r--r-- 2.3 unx 64704 tx 15588 defN 19-Apr-09 00:39 sample1.txt
-rw-r--r-- 2.3 unx 23052 tx 6775 defN 19-Apr-09 00:39 sample2.txt
▷ -T … -s と似ているが、タイムスタンプを YYYYMDD.HHMMSS 形式で表示する。
% zipinfo -T exmaple.zip
-rw-r--r-- 2.3 unx 64704 tx defN 20090419.003950 sample1.txt
-rw-r--r-- 2.3 unx 23052 tx defN 20090419.003955 sample2.txt
▷ -1 … ファイル一覧のみを表示する
% zipinfo -1 exmaple.zip
sample1.txt
sample2.txt
sample3.txt
sample4.dat
▷ -h … ヘッダ行のみ表示する。
% zipinfo example.zip
Archive: exmaple.zip 42433 bytes 4 files
▷ -t … フッタ行のみ表示する。
% zipinfo example.zip
4 files, 196251 bytes uncompressed, 41883 bytes compressed: 78.7%