MoonPoint Support Logo


Shop Amazon Warehouse Deals - Deep Discounts on Open-box and Used ProductsAmazon Warehouse Deals

Advanced Search
Sun Mon Tue Wed Thu Fri Sat

Thu, Aug 04, 2016 10:53 pm

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
-rw-r--r--. 1 joe joe 57641 Jun 28  2013
$ zipinfo
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

[ More Info ]

[/os/unix/commands] permanent link

Once You Know, You Newegg AliExpress by

Shop Amazon Local - Subscribe to Deals in Your Neighborhood

Valid HTML 4.01 Transitional

Privacy Policy   Contact

Blosxom logo