Using the zipinfo command

If you wish to view a list of the files contained in a zip file, i.e., one with a .zip extension, on Linux and Mac OS X systems you can use the zipinfo command. If you enter the command zipinfo followed by the name of the zip file, you will see a Unix-style file listing for each compressed file contained within the zip file.

$ ls -l vnc-osx.zip
-rw-r--r--. 1 joe joe 57641 Jun 28  2013 vnc-osx.zip
$ zipinfo vnc-osx.zip
Archive:  vnc-osx.zip
Zip file size: 57641 bytes, number of entries: 4
drwxr-xr-x  3.0 unx        0 bx stor 13-Jun-28 12:43 vnc/
-rw-r--r--  3.0 unx    21375 bx defN 13-Jun-27 20:31 vnc/Connect_to_Server.png
-rw-r--r--  3.0 unx    36303 bx defN 13-Jun-27 20:33 vnc/Enter_Name_Password.png
-rw-r--r--  3.0 unx     2834 tx defN 13-Jun-28 12:43 vnc/vnc-remote-access.html
4 files, 60512 bytes uncompressed, 56943 bytes compressed:  5.9%
$

In the example above you can see that there are three files stored in the zip file; the output indicates 4 files because the directory, vnc, is counted as a file on a Unix system. The total bytes for the four files before they were compressed into a zip file is 60,512 bytes. They were compressed down to 56,943 bytes, which is a 5.9% compression ratio, since (60512 - 56943) / 60512.0 * 100 = 5.9.

If you just wish to see the file and directory names contained in the zip file, you can use the -1 argument (that's the number one).

$ zipinfo -1 vnc-osx.zip
vnc/
vnc/Connect_to_Server.png
vnc/Enter_Name_Password.png
vnc/vnc-remote-access.html
$

If you just wish to see the size of the zip file and the number of files within it, you can use the -h argument.

$ zipinfo -h vnc-osx.zip
Archive:  vnc-osx.zip
Zip file size: 57641 bytes, number of entries: 4
$

If you wish to see a plethora of detail regarding the zip file and the files contained within it, use the -v option for verbose output.




Generic Category (English)120x600


Hide.me 25% discount
$ zipinfo -v vnc-osx.zip
Archive:  vnc-osx.zip
There is no zipfile comment.

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

  Zip archive file size:                     57641 (000000000000E129h)
  Actual end-cent-dir record offset:         57619 (000000000000E113h)
  Expected end-cent-dir record offset:       57619 (000000000000E113h)
  (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 362 (000000000000016Ah) bytes long,
  and its (expected) offset in bytes from the beginning of the zipfile
  is 57257 (000000000000DFA9h).


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

  vnc/

  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):          2013 Jun 28 12:43:30
  file last modified on (UT extra field modtime): 2013 Jun 28 12:43:30 local
  file last modified on (UT extra field modtime): 2013 Jun 28 16:43:30 UTC
  32-bit CRC value (hex):                         00000000
  compressed size:                                0 bytes
  uncompressed size:                              0 bytes
  length of filename:                             4 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 43 eb 1a 2b 04 0b 78 a8 4c.

  There is no file comment.

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

  vnc/Connect_to_Server.png

  offset of local header from start of archive:   62
                                                  (000000000000003Eh) 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:   2.0
  compression method:                             deflated
  compression sub-type (deflation):               normal
  file security status:                           not encrypted
  extended local header:                          no
  file last modified on (DOS date/time):          2013 Jun 27 20:31:52
  file last modified on (UT extra field modtime): 2013 Jun 27 20:31:51 local
  file last modified on (UT extra field modtime): 2013 Jun 28 00:31:51 UTC
  32-bit CRC value (hex):                         e1ab7e72
  compressed size:                                20341 bytes
  uncompressed size:                              21375 bytes
  length of filename:                             25 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 (100644 octal):            -rw-r--r--
  MS-DOS file attributes (00 hex):                none

  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 43 eb 1a 2b 04 0b 78 a8 4c.

  There is no file comment.

Central directory entry #3:
---------------------------

  vnc/Enter_Name_Password.png

  offset of local header from start of archive:   20486
                                                  (0000000000005006h) 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:   2.0
  compression method:                             deflated
  compression sub-type (deflation):               normal
  file security status:                           not encrypted
  extended local header:                          no
  file last modified on (DOS date/time):          2013 Jun 27 20:33:24
  file last modified on (UT extra field modtime): 2013 Jun 27 20:33:24 local
  file last modified on (UT extra field modtime): 2013 Jun 28 00:33:24 UTC
  32-bit CRC value (hex):                         e1c74c65
  compressed size:                                35332 bytes
  uncompressed size:                              36303 bytes
  length of filename:                             27 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 (100644 octal):            -rw-r--r--
  MS-DOS file attributes (00 hex):                none

  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 43 eb 1a 2b 04 0b 78 a8 4c.

  There is no file comment.

Central directory entry #4:
---------------------------

  vnc/vnc-remote-access.html

  offset of local header from start of archive:   55903
                                                  (000000000000DA5Fh) 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:   2.0
  compression method:                             deflated
  compression sub-type (deflation):               normal
  file security status:                           not encrypted
  extended local header:                          no
  file last modified on (DOS date/time):          2013 Jun 28 12:43:30
  file last modified on (UT extra field modtime): 2013 Jun 28 12:43:30 local
  file last modified on (UT extra field modtime): 2013 Jun 28 16:43:30 UTC
  32-bit CRC value (hex):                         704d3f8d
  compressed size:                                1270 bytes
  uncompressed size:                              2834 bytes
  length of filename:                             26 characters
  length of extra field:                          24 bytes
  length of file comment:                         0 characters
  disk number on which file begins:               disk 1
  apparent file type:                             text
  Unix file attributes (100644 octal):            -rw-r--r--
  MS-DOS file attributes (00 hex):                none

  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 43 eb 1a 2b 04 0b 78 a8 4c.

  There is no file comment.

$

You may even be able to glean information about the operating system on which the zip file was created from the zipinfo command. E.g., the above zip file was created from the command line on an Apple system running the OS X operating system. The "file system or operating system of origin" value shown is "Unix". The core of the OS X operating system is a POSIX compliant operating system (OS); POSIX is a family of standards for software compatibility between Unix and other operating systems. Checking the files in another zip file created on a system running the Microsoft Windows operating system, I see the following files listed:

$ zipinfo -1 Encrypted_Folder.zip
Encrypted_Folders/advanced_attributes.png
Encrypted_Folders/confirm_attribute_changes.png
Encrypted_Folders/directory_properties.png
Encrypted_Folders/encrypted_files.png
Encrypted_Folders/encrypted_folder.png
Encrypted_Folders/encryption_selected.png
Encrypted_Folders/unencrypted_directories.png

If I don't want to see the details for every file in the zip file, but only one file, I can use the -v option for verbose output, but specify that file at the end of the command as shown below (the directory path within the zip file needs to be specified as well):

Aiseesoft Mac Video Converter Ultimate
$ zipinfo -v Encrypted_Folder.zip Encrypted_Folders/advanced_attributes.png
Archive:  Encrypted_Folder.zip
There is no zipfile comment.

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

  Zip archive file size:                     84983 (0000000000014BF7h)
  Actual end-cent-dir record offset:         84961 (0000000000014BE1h)
  Expected end-cent-dir record offset:       84961 (0000000000014BE1h)
  (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 7 entries.
  The central directory is 613 (0000000000000265h) bytes long,
  and its (expected) offset in bytes from the beginning of the zipfile
  is 84348 (000000000001497Ch).


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

  Encrypted_Folders/advanced_attributes.png

  offset of local header from start of archive:   0
                                                  (0000000000000000h) bytes
  file system or operating system of origin:      MS-DOS, OS/2 or NT FAT
  version of encoding software:                   2.0
  minimum file system compatibility required:     MS-DOS, OS/2 or NT FAT
  minimum software version required to extract:   2.0
  compression method:                             deflated
  compression sub-type (deflation):               normal
  file security status:                           not encrypted
  extended local header:                          no
  file last modified on (DOS date/time):          2016 Apr 3 12:51:06
  32-bit CRC value (hex):                         2609a8f3
  compressed size:                                9872 bytes
  uncompressed size:                              10605 bytes
  length of filename:                             41 characters
  length of extra field:                          0 bytes
  length of file comment:                         0 characters
  disk number on which file begins:               disk 1
  apparent file type:                             binary
  non-MSDOS external file attributes:             000000 hex
  MS-DOS file attributes (20 hex):                arc 

  There is no file comment.

$

In the above case for the zip file created on a Microsoft Windows system, I see "file system or operating system of origin: MS-DOS, OS/2 or NT FAT" rather than "Unix".

 

TechRabbit ad 300x250 newegg.com

Justdeals Daily Electronics Deals1x1 px