zipinfoコマンドを使う。以下はこの記事で作成したZIP形式のアーカイブファイルを使用して中身を確認した例。-mオプションを付けると少し詳しい内容を表示する。-lオプションを付けるともう少し詳しい内容を表示する。
$ zipinfo seiyu.zip Archive: seiyu.zip Zip file size: 182190 bytes, number of entries: 3 -rw-rw-r-- 3.0 unx 1600000 tx defN 24-Jan-11 23:14 石見舞菜香.txt -rw-rw-r-- 3.0 unx 1600000 tx defN 24-Jan-11 23:14 野口瑠璃子.txt -rw-rw-r-- 3.0 unx 1600000 tx defN 24-Jan-11 23:14 和多田美咲.txt 3 files, 4800000 bytes uncompressed, 181670 bytes compressed: 96.2% $ zipinfo -1 seiyu.zip 石見舞菜香.txt 野口瑠璃子.txt 和多田美咲.txt $ zipinfo -m seiyu.zip Archive: seiyu.zip Zip file size: 182190 bytes, number of entries: 3 -rw-rw-r-- 3.0 unx 1600000 tx 96% defN 24-Jan-11 23:14 石見舞菜香.txt -rw-rw-r-- 3.0 unx 1600000 tx 96% defN 24-Jan-11 23:14 野口瑠璃子.txt -rw-rw-r-- 3.0 unx 1600000 tx 96% defN 24-Jan-11 23:14 和多田美咲.txt 3 files, 4800000 bytes uncompressed, 181670 bytes compressed: 96.2% $ zipinfo -l seiyu.zip Archive: seiyu.zip Zip file size: 182190 bytes, number of entries: 3 -rw-rw-r-- 3.0 unx 1600000 tx 60571 defN 24-Jan-11 23:14 石見舞菜香.txt -rw-rw-r-- 3.0 unx 1600000 tx 60488 defN 24-Jan-11 23:14 野口瑠璃子.txt -rw-rw-r-- 3.0 unx 1600000 tx 60611 defN 24-Jan-11 23:14 和多田美咲.txt 3 files, 4800000 bytes uncompressed, 181670 bytes compressed: 96.2%
zipinfoコマンドはunzipに-Zオプションを付けて実行することと同じため(「zipinfo」=「unzip -Z」)、zipinfoコマンドが見つからない場合は、unzipコマンドが代用できる。-lオプションを付けると、展開はせずにZIPファイル内のファイルの一覧を表示する。-vオプションを付けると、もう少し詳しくファイルの一覧を表示する。
$ unzip -l seiyu.zip Archive: seiyu.zip Length Date Time Name --------- ---------- ----- ---- 1600000 2024-01-11 23:14 石見舞菜香.txt 1600000 2024-01-11 23:14 野口瑠璃子.txt 1600000 2024-01-11 23:14 和多田美咲.txt --------- ------- 4800000 3 files $ unzip -v seiyu.zip Archive: seiyu.zip Length Method Size Cmpr Date Time CRC-32 Name -------- ------ ------- ---- ---------- ----- -------- ---- 1600000 Defl:N 60571 96% 2024-01-11 23:14 cf311c9c 石見舞菜香.txt 1600000 Defl:N 60488 96% 2024-01-11 23:14 d5963934 野口瑠璃子.txt 1600000 Defl:N 60611 96% 2024-01-11 23:14 36e7250f 和多田美咲.txt -------- ------- --- ------- 4800000 181670 96% 3 files