日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 运维知识 > linux >内容正文

linux

【Linux】一步一步学Linux——zipinfo命令(69)

發布時間:2024/4/21 linux 30 豆豆
生活随笔 收集整理的這篇文章主要介紹了 【Linux】一步一步学Linux——zipinfo命令(69) 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

00. 目錄

文章目錄

    • 00. 目錄
    • 01. 命令概述
    • 02. 命令格式
    • 03. 常用選項
    • 04. 參考示例
    • 05. 附錄

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.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 只顯示壓縮包大小、文件數目

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

4.4 生成一個基本的、長格式的列表,包括標題和總計行

[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 將壓縮文件內每個文件的日期時間用年,月,日,時,分,秒的順序列出

[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】一步一步學Linux系列教程匯總

總結

以上是生活随笔為你收集整理的【Linux】一步一步学Linux——zipinfo命令(69)的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。