【Linux】一步一步学Linux——zipinfo命令(69)
生活随笔
收集整理的這篇文章主要介紹了
【Linux】一步一步学Linux——zipinfo命令(69)
小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.
00. 目錄
文章目錄
- 00. 目錄
- 01. 命令概述
- 02. 命令格式
- 03. 常用選項
- 04. 參考示例
- 05. 附錄
01. 命令概述
zipinfo命令的全稱為“zip information”,該命令用于列出壓縮文件信息。執(zhí)行zipinfo指令可得知zip壓縮文件的詳細(xì)信息。
02. 命令格式
zipinfo [-12hlmMstTvz][壓縮文件][文件...][-x <范本樣式>]03. 常用選項
-1:只列出文件名稱; -2:此參數(shù)的效果和指定“-1”參數(shù)類似,但可搭配“-h”,“-t”和“-z”參數(shù)使用; -h:只列出壓縮文件的文件名稱; -l:此參數(shù)的效果和指定“-m”參數(shù)類似,但會列出原始文件的大小而非每個文件的壓縮率; -m:此參數(shù)的效果和指定“-s”參數(shù)類似,但多會列出每個文件的壓縮率; -M:若信息內(nèi)容超過一個畫面,則采用類似more指令的方式列出信息; -s:用類似執(zhí)行“l(fā)s-l”指令的效果列出壓縮文件內(nèi)容; -t:只列出壓縮文件內(nèi)所包含的文件數(shù)目,壓縮前后的文件大小及壓縮率; -T:將壓縮文件內(nèi)每個文件的日期時間用年,月,日,時,分,秒的順序列出; -v:詳細(xì)顯示壓縮文件內(nèi)每一個文件的信息; -x<范本樣式>:不列出符合條件的文件的信息; -z:如果壓縮文件內(nèi)含有注釋,就將注釋顯示出來。04. 參考示例
4.1 顯示壓縮文件信息
[deng@localhost test]$ zipinfo file.zip Archive: file.zip Zip 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.sh 4 files, 2080 bytes uncompressed, 1044 bytes compressed: 49.8% [deng@localhost test]$4.2 顯示壓縮文件中每個文件的信息
[deng@localhost test]$ zipinfo -v file.zip Archive: file.zip There 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; itscentral directory contains 4 entries.The central directory is 296 (0000000000000128h) bytes long,and its (expected) offset in bytes from the beginning of the zipfileis 1292 (000000000000050Ch).4.3 只顯示壓縮包大小、文件數(shù)目
[deng@localhost test]$ zipinfo -h file.zip Archive: file.zip Zip file size: 1610 bytes, number of entries: 4 [deng@localhost test]$4.4 生成一個基本的、長格式的列表,包括標(biāo)題和總計行
[deng@localhost test]$ zipinfo -l file.zip Archive: file.zip Zip 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.sh 4 files, 2080 bytes uncompressed, 1044 bytes compressed: 49.8% [deng@localhost test]$4.5 將壓縮文件內(nèi)每個文件的日期時間用年,月,日,時,分,秒的順序列出
[deng@localhost test]$ zipinfo -T file.zip Archive: file.zip Zip 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.sh 4 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.sh Zip file size: 1610 bytes, number of entries: 4 Archive: file.zip 4 files, 2080 bytes uncompressed, 1044 bytes compressed: 49.8% [deng@localhost test]$05. 附錄
參考:【Linux】一步一步學(xué)Linux系列教程匯總
總結(jié)
以上是生活随笔為你收集整理的【Linux】一步一步学Linux——zipinfo命令(69)的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 【Tools】Linux远程连接工具(P
- 下一篇: 【Linux】一步一步学Linux——b