In Ubuntu, installed on Windows Subsystem for Linux, I want to see the content of a zip file, using gzip --list.

I expected to see a list of included files like this:

FileName    ratio
File1       10%
File2       35%

Instead I just see some information on the compression of the zip file:

gzip --list "2019_02_04 05_01_24_Internal_File_2019_02_04 06_00_02.zip"
     compressed        uncompressed  ratio uncompressed_name
          38994                  -1   0.0% 2019_02_04 05_01_24_Internal_File_2019_02_04 06_00_02.zip

… and it's bogus information!  How do I obtain a list of the files archived in that zip file?


Gzip (.gz) and Zip (.zip) are two different file formats - you're using the gzip tool on a zip archive.

Try using unzip -lv 2019_02_04 05_01_24_Internal_File_2019_02_04 06_00_02.zip

The output should look something like this:

#unzip -lv test.zip
Archive:  test.zip
 Length   Method    Size  Cmpr    Date    Time   CRC-32   Name
--------  ------  ------- ---- ---------- ----- --------  ----
     528  Defl:N      334  37% 2017-06-19 17:33 b9fd9cb9  test.py
--------          -------  ---                            -------
     528              334  37%                            1 file

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.