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 $
[ More Info ]