zipinfo 命令

| 选择喜欢的代码风格  

zipinfo 命令安装:


$ zipinfo
-bash: zipinfo: command not found

#CentOS
yum install zip

#Ubuntu 
apt-get install zip

zipinfo 命令补充说明:


zipinfo命令 用来列出压缩文件信息。执行zipinfo指令可得知zip压缩文件的详细信息。

zipinfo 命令语法:


zipinfo (选项)(参数)

zipinfo 命令选项:


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

zipinfo 命令参数:


文件:指定zip格式的压缩包。

zipinfo 命令实例:


显示zip压缩文件 NginxModule.zip 信息

[root@TestMaster /Data/tools]
# zipinfo NginxModule.zip 
Archive:  NginxModule.zip
Zip file size: 43690 bytes, number of entries: 44
drwxr-xr-x  3.0 unx        0 bx stor 19-Jan-23 17:18 NginxModule/
drwxr-xr-x  3.0 unx        0 bx stor 19-Jan-31 18:46 NginxModule/nginx-http-concat/
drwxr-xr-x  3.0 unx        0 bx stor 19-Jan-31 18:46 NginxModule/nginx-http-concat/.git/
drwxr-xr-x  3.0 unx        0 bx stor 19-Jan-23 17:18 NginxModule/nginx-http-concat/.git/refs/
drwxr-xr-x  3.0 unx        0 bx stor 19-Jan-23 17:18 NginxModule/nginx-http-concat/.git/refs/heads/
-rw-r--r--  3.0 unx       41 tx stor 19-Jan-23 17:18 NginxModule/nginx-http-concat/.git/refs/heads/master
drwxr-xr-x  3.0 unx        0 bx stor 19-Jan-23 17:18 NginxModule/nginx-http-concat/.git/refs/tags/
drwxr-xr-x  3.0 unx        0 bx stor 19-Jan-23 17:18 NginxModule/nginx-http-concat/.git/refs/remotes/
drwxr-xr-x  3.0 unx        0 bx stor 19-Jan-23 17:18 NginxModule/nginx-http-concat/.git/refs/remotes/origin/
-rw-r--r--  3.0 unx       32 tx stor 19-Jan-23 17:18 NginxModule/nginx-http-concat/.git/refs/remotes/origin/HEAD
drwxr-xr-x  3.0 unx        0 bx stor 19-Jan-23 17:18 NginxModule/nginx-http-concat/.git/branches/
-rw-r--r--  3.0 unx       73 tx defN 19-Jan-23 17:18 NginxModule/nginx-http-concat/.git/description
drwxr-xr-x  3.0 unx        0 bx stor 19-Jan-23 17:18 NginxModule/nginx-http-concat/.git/hooks/
-rwxr-xr-x  3.0 unx      452 tx defN 19-Jan-23 17:18 NginxModule/nginx-http-concat/.git/hooks/applypatch-msg.sample
-rwxr-xr-x  3.0 unx      896 tx defN 19-Jan-23 17:18 NginxModule/nginx-http-concat/.git/hooks/commit-msg.sample
-rwxr-xr-x  3.0 unx      189 tx defN 19-Jan-23 17:18 NginxModule/nginx-http-concat/.git/hooks/post-update.sample
-rwxr-xr-x  3.0 unx      398 tx defN 19-Jan-23 17:18 NginxModule/nginx-http-concat/.git/hooks/pre-applypatch.sample
-rwxr-xr-x  3.0 unx     1704 tx defN 19-Jan-23 17:18 NginxModule/nginx-http-concat/.git/hooks/pre-commit.sample
-rw-r--r--  3.0 unx     1348 tx defN 19-Jan-23 17:18 NginxModule/nginx-http-concat/.git/hooks/pre-push.sample
-rwxr-xr-x  3.0 unx     4951 tx defN 19-Jan-23 17:18 NginxModule/nginx-http-concat/.git/hooks/pre-rebase.sample
-rwxr-xr-x  3.0 unx     1239 tx defN 19-Jan-23 17:18 NginxModule/nginx-http-concat/.git/hooks/prepare-commit-msg.sample
-rwxr-xr-x  3.0 unx     3611 tx defN 19-Jan-23 17:18 NginxModule/nginx-http-concat/.git/hooks/update.sample
drwxr-xr-x  3.0 unx        0 bx stor 19-Jan-23 17:18 NginxModule/nginx-http-concat/.git/info/
-rw-r--r--  3.0 unx      240 tx defN 19-Jan-23 17:18 NginxModule/nginx-http-concat/.git/info/exclude
-rw-r--r--  3.0 unx       23 tx stor 19-Jan-23 17:18 NginxModule/nginx-http-concat/.git/HEAD
-rw-r--r--  3.0 unx      271 tx defN 19-Jan-23 17:18 NginxModule/nginx-http-concat/.git/config
drwxr-xr-x  3.0 unx        0 bx stor 19-Jan-23 17:18 NginxModule/nginx-http-concat/.git/objects/
drwxr-xr-x  3.0 unx        0 bx stor 19-Jan-23 17:18 NginxModule/nginx-http-concat/.git/objects/pack/
-r--r--r--  3.0 unx    18019 bx defN 19-Jan-23 17:18 NginxModule/nginx-http-concat/.git/objects/pack/pack-b2899fdded8db01aef1d5c1bca9aa1f5adafeb84.pack
-r--r--r--  3.0 unx     3200 bx defN 19-Jan-23 17:18 NginxModule/nginx-http-concat/.git/objects/pack/pack-b2899fdded8db01aef1d5c1bca9aa1f5adafeb84.idx
drwxr-xr-x  3.0 unx        0 bx stor 19-Jan-23 17:18 NginxModule/nginx-http-concat/.git/objects/info/
-rw-r--r--  3.0 unx      164 tx defN 19-Jan-23 17:18 NginxModule/nginx-http-concat/.git/packed-refs
drwxr-xr-x  3.0 unx        0 bx stor 19-Jan-23 17:18 NginxModule/nginx-http-concat/.git/logs/
drwxr-xr-x  3.0 unx        0 bx stor 19-Jan-23 17:18 NginxModule/nginx-http-concat/.git/logs/refs/
drwxr-xr-x  3.0 unx        0 bx stor 19-Jan-23 17:18 NginxModule/nginx-http-concat/.git/logs/refs/remotes/
drwxr-xr-x  3.0 unx        0 bx stor 19-Jan-23 17:18 NginxModule/nginx-http-concat/.git/logs/refs/remotes/origin/
-rw-r--r--  3.0 unx      188 tx defN 19-Jan-23 17:18 NginxModule/nginx-http-concat/.git/logs/refs/remotes/origin/HEAD
drwxr-xr-x  3.0 unx        0 bx stor 19-Jan-23 17:18 NginxModule/nginx-http-concat/.git/logs/refs/heads/
-rw-r--r--  3.0 unx      188 tx defN 19-Jan-23 17:18 NginxModule/nginx-http-concat/.git/logs/refs/heads/master
-rw-r--r--  3.0 unx      188 tx defN 19-Jan-23 17:18 NginxModule/nginx-http-concat/.git/logs/HEAD
-rw-r--r--  3.0 unx      264 bx defN 19-Jan-31 18:41 NginxModule/nginx-http-concat/.git/index
-rw-r--r--  3.0 unx     7664 tx defN 19-Jan-23 17:18 NginxModule/nginx-http-concat/README.md
-rw-r--r--  3.0 unx      163 tx defN 19-Jan-23 17:18 NginxModule/nginx-http-concat/config
-rw-r--r--  3.0 unx    15361 tx defN 19-Jan-31 18:41 NginxModule/nginx-http-concat/ngx_http_concat_module.c
44 files, 60867 bytes uncompressed, 33604 bytes compressed:  44.8%

显示压缩文件 NginxModule.zip 中每个文件的信息

[root@TestMaster /Data/tools]
# zipinfo -v NginxModule.zip |more
Archive:  NginxModule.zip
There is no zipfile comment.

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

  Zip archive file size:                     43690 (000000000000AAAAh)
  Actual end-cent-dir record offset:         43668 (000000000000AA94h)
  Expected end-cent-dir record offset:       43668 (000000000000AA94h)
  (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 44 entries.
  The central directory is 5296 (00000000000014B0h) bytes long,
  and its (expected) offset in bytes from the beginning of the zipfile
  is 38372 (00000000000095E4h).


Central directory entry #1:
---------------------------

  NginxModule/

  offset of local header from start of archive:   0
                                                  (0000000000000000h) bytes
  file system or operating system of origin:      Unix
  version of encoding software:                   3.0
  minimum file system compatibility required:     MS-DOS, OS/2 or NT FAT
  minimum software version required to extract:   1.0
  compression method:                             none (stored)
  file security status:                           not encrypted
  extended local header:                          no
  file last modified on (DOS date/time):          2019 Jan 23 17:18:24
  file last modified on (UT extra field modtime): 2019 Jan 23 17:18:23 local
  file last modified on (UT extra field modtime): 2019 Jan 23 09:18:23 UTC
  32-bit CRC value (hex):                         00000000
  compressed size:                                0 bytes
  uncompressed size:                              0 bytes
  length of filename:                             12 characters
  length of extra field:                          24 bytes
  length of file comment:                         0 characters
  disk number on which file begins:               disk 1
  apparent file type:                             binary
  Unix file attributes (040755 octal):            drwxr-xr-x
  MS-DOS file attributes (10 hex):                dir 

  The central-directory extra field contains:
  - A subfield with ID 0x5455 (universal time) and 5 data bytes.
    The local extra field has UTC/GMT modification/access times.
  - A subfield with ID 0x7875 (Unix UID/GID (any size)) and 11 data bytes:
    01 04 00 00 00 00 04 00 00 00 00.

  There is no file comment.

Central directory entry #2:
---------------------------

  NginxModule/nginx-http-concat/

  offset of local header from start of archive:   70
                                                  (0000000000000046h) bytes
  file system or operating system of origin:      Unix
  version of encoding software:                   3.0
  minimum file system compatibility required:     MS-DOS, OS/2 or NT FAT
  minimum software version required to extract:   1.0
  compression method:                             none (stored)
  file security status:                           not encrypted
  extended local header:                          no

zipinfo 命令扩展阅读:




发表评论