【Linux】一步一步学Linux——zipinfo命令(69)
发布日期:2021-06-29 21:00:06 浏览次数:2 分类:技术文章

本文共 3248 字,大约阅读时间需要 10 分钟。

00. 目录

文章目录

01. 命令概述

zipinfo命令的全称为“zip information”,该命令用于列出压缩文件信息。执行zipinfo指令可得知zip压缩文件的详细信息。

02. 命令格式

zipinfo [-12hlmMstTvz][压缩文件][文件...][-x 
<范本样式>
]

03. 常用选项

-1:只列出文件名称;-2:此参数的效果和指定“-1”参数类似,但可搭配“-h”,“-t”和“-z”参数使用;-h:只列出压缩文件的文件名称;-l:此参数的效果和指定“-m”参数类似,但会列出原始文件的大小而非每个文件的压缩率;-m:此参数的效果和指定“-s”参数类似,但多会列出每个文件的压缩率;-M:若信息内容超过一个画面,则采用类似more指令的方式列出信息;-s:用类似执行“ls-l”指令的效果列出压缩文件内容;-t:只列出压缩文件内所包含的文件数目,压缩前后的文件大小及压缩率;-T:将压缩文件内每个文件的日期时间用年,月,日,时,分,秒的顺序列出;-v:详细显示压缩文件内每一个文件的信息;-x
<范本样式>
:不列出符合条件的文件的信息;-z:如果压缩文件内含有注释,就将注释显示出来。

04. 参考示例

4.1 显示压缩文件信息

[deng@localhost test]$ zipinfo file.zip Archive:  file.zipZip file size: 1610 bytes, number of entries: 4-rwxrwxr-x  3.0 unx      520 tx defN 19-Jul-28 21:59 a.sh-rwxrwxr-x  3.0 unx      520 tx defN 19-Jul-28 21:59 b.sh-rwxrwxr-x  3.0 unx      520 tx defN 19-Jul-28 21:59 c.sh-rwxrwxr-x  3.0 unx      520 tx defN 19-Jul-28 21:59 d.sh4 files, 2080 bytes uncompressed, 1044 bytes compressed:  49.8%[deng@localhost test]$

4.2 显示压缩文件中每个文件的信息

[deng@localhost test]$ zipinfo -v file.zip Archive:  file.zipThere is no zipfile comment.End-of-central-directory record:-------------------------------  Zip archive file size:                      1610 (000000000000064Ah)  Actual end-cent-dir record offset:          1588 (0000000000000634h)  Expected end-cent-dir record offset:        1588 (0000000000000634h)  (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 4 entries.  The central directory is 296 (0000000000000128h) bytes long,  and its (expected) offset in bytes from the beginning of the zipfile  is 1292 (000000000000050Ch).

4.3 只显示压缩包大小、文件数目

[deng@localhost test]$ zipinfo -h file.zip Archive:  file.zipZip file size: 1610 bytes, number of entries: 4[deng@localhost test]$

4.4 生成一个基本的、长格式的列表,包括标题和总计行

[deng@localhost test]$ zipinfo -l file.zip Archive:  file.zipZip file size: 1610 bytes, number of entries: 4-rwxrwxr-x  3.0 unx      520 tx      261 defN 19-Jul-28 21:59 a.sh-rwxrwxr-x  3.0 unx      520 tx      261 defN 19-Jul-28 21:59 b.sh-rwxrwxr-x  3.0 unx      520 tx      261 defN 19-Jul-28 21:59 c.sh-rwxrwxr-x  3.0 unx      520 tx      261 defN 19-Jul-28 21:59 d.sh4 files, 2080 bytes uncompressed, 1044 bytes compressed:  49.8%[deng@localhost test]$

4.5 将压缩文件内每个文件的日期时间用年,月,日,时,分,秒的顺序列出

[deng@localhost test]$ zipinfo -T file.zip Archive:  file.zipZip file size: 1610 bytes, number of entries: 4-rwxrwxr-x  3.0 unx      520 tx defN 20190728.215900 a.sh-rwxrwxr-x  3.0 unx      520 tx defN 20190728.215906 b.sh-rwxrwxr-x  3.0 unx      520 tx defN 20190728.215909 c.sh-rwxrwxr-x  3.0 unx      520 tx defN 20190728.215913 d.sh4 files, 2080 bytes uncompressed, 1044 bytes compressed:  49.8%[deng@localhost test]$

4.6 查看存档中最近修改的文件,排序列出

[deng@localhost test]$ zipinfo -T file.zip | sort -nr -k 7 -rwxrwxr-x  3.0 unx      520 tx defN 20190728.215913 d.sh-rwxrwxr-x  3.0 unx      520 tx defN 20190728.215909 c.sh-rwxrwxr-x  3.0 unx      520 tx defN 20190728.215906 b.sh-rwxrwxr-x  3.0 unx      520 tx defN 20190728.215900 a.shZip file size: 1610 bytes, number of entries: 4Archive:  file.zip4 files, 2080 bytes uncompressed, 1044 bytes compressed:  49.8%[deng@localhost test]$

05. 附录

参考:

转载地址:https://dengjin.blog.csdn.net/article/details/97620459 如侵犯您的版权,请留言回复原文章的地址,我们会给您删除此文章,给您带来不便请您谅解!

上一篇:【Linux】一步一步学Linux——bzip2recover命令(70)
下一篇:【Tools】Linux远程连接工具(PuTTY)

发表评论

最新留言

能坚持,总会有不一样的收获!
[***.219.124.196]2024年04月13日 08时01分25秒

关于作者

    喝酒易醉,品茶养心,人生如梦,品茶悟道,何以解忧?唯有杜康!
-- 愿君每日到此一游!

推荐文章

弘辽科技:小伙退伍网上创业卖特产,教你免费如何开淘宝网店 2019-04-30
弘辽科技:80后女大学生开网店创业 年销售额达100万元 2019-04-30
弘辽科技:从开网店,到拥有自己的公司、厂房、基地。 2019-04-30
弘辽科技:淘宝开店后怎么建群?手机端怎么建群? 2019-04-30
弘辽科技:新电商掌门人:陈磊、蒋凡、徐雷「掰手腕」 2019-04-30
弘辽科技:新手前期如何开网店? 2019-04-30
弘辽科技:一件代发什么商品最容易赚钱?怎么做优化? 2019-04-30
弘辽科技:新手前期如何开网店? 2019-04-30
弘辽科技:现在怎么做淘宝赚钱?有什么办法或者方案用淘宝赚钱? 2019-04-30
弘辽科技:拼多多店铺星级多久更新一次?如何提升? 2019-04-30
弘辽科技:拼多多店铺星级有用吗?什么是星级? 2019-04-30
弘辽科技:拼多多客单价怎么算?如何提高? 2019-04-30
弘辽科技:拼多多商品详情图怎么做?有什么开店技巧? 2019-04-30
弘辽科技:宝妈适合做什么?适合宝妈的25个副业 2019-04-30
弘辽科技:老店新开没有自然流量怎么办? 2019-04-30
弘辽科技:拼多多小额收款多久到账?有些什么限制呢? 2019-04-30
如何利用小程序降低获客成本 2019-04-30
OMG,小程序居然免费啦 2019-04-30
电商系统新功能:折扣码和折扣分享码带来更多营销新玩法 2019-04-30
快速开通百度智能小程序攻略 2019-04-30