暂无图片
暂无图片
暂无图片
暂无图片
暂无图片

zipinfo命令 – 查看压缩文件信息

原创 4903 2022-12-29
1051

zipinfo命令来自于英文词组“zip information”的缩写,其功能是用于查看压缩文件信息。zipinfo命令可以查看zip格式压缩包内的文件列表及详细信息。

语法格式:zipinfo [参数] 压缩包

常用参数:

-1只列出文件名称
-h只列出压缩文件名称
-l列出原始文件的大小
-m列出每个文件的压缩率
-M以分页形式显示内容
-s列出压缩文件内容
-t列出压缩前后大小及压缩率
-T列出每个文件的日期时间
-v详细显示每一个文件的信息
-x<范本样式>不列出符合条件的文件的信息
-z将注释显示出来

参考实例

显示压缩包内的文件名称及简要属性信息:

[root@linuxcool ~]# zipinfo file.zip 
Archive:  file.zip
Zip file size: 1937 bytes, number of entries: 2
-rw-------  3.0 unx     1256 tx defN 21-Dec-14 08:42 anaconda-ks.cfg
-rw-r--r--  3.0 unx     1585 tx defN 21-Dec-14 08:43 initial-setup-ks.cfg
2 files, 2841 bytes uncompressed, 1589 bytes compressed:  44.1%

显示压缩包内的文件名称及详细属性信息:

[root@linuxcool ~]# zipinfo -v file.zip 
Archive:  file.zip
There is no zipfile comment.

End-of-central-directory record:
-------------------------------

  Zip archive file size:                      1937 (0000000000000791h)
  Actual end-cent-dir record offset:          1915 (000000000000077Bh)
  Expected end-cent-dir record offset:        1915 (000000000000077Bh)
  (based on the length of the central directory and its expected offset)

  This zipfile constitutes the sole disk of a single-part archive; its
  central directory contains 2 entries.
  The central directory is 175 (00000000000000AFh) bytes long,
  and its (expected) offset in bytes from the beginning of the zipfile
  is 1740 (00000000000006CCh).
………………省略部分输出信息………………

仅显示压缩包内文件大小及数目信息:

[root@linuxcool ~]# zipinfo -h file.zip
Archive:  file.zip
Zip file size: 1937 bytes, number of entries: 2

仅显示压缩包内文件最后修改时间及简要属性信息:

[root@linuxcool ~]# zipinfo -T file.zip 
Archive:  file.zip
Zip file size: 1937 bytes, number of entries: 2
-rw-------  3.0 unx     1256 tx defN 20211214.084220 anaconda-ks.cfg
-rw-r--r--  3.0 unx     1585 tx defN 20211214.084343 initial-setup-ks.cfg
2 files, 2841 bytes uncompressed, 1589 bytes compressed:  44.1%
「喜欢这篇文章,您的关注和赞赏是给作者最好的鼓励」
关注作者
【版权声明】本文为墨天轮用户原创内容,转载时必须标注文章的来源(墨天轮),文章链接,文章作者等基本信息,否则作者和墨天轮有权追究责任。如果您发现墨天轮中有涉嫌抄袭或者侵权的内容,欢迎发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。

评论