2

Suppose I have a ZIP archive myfiles.zip. To list the files inside the ZIP file, I could do zip -sf myfiles.zip, which results in:

Archive contains:
  files/mypic.jpg
  files/myvideo.mp4
Total 2 entries (12345678 bytes)

Is there a way to list these files together with their file sizes? For example:

Archive contains:
  files/mypic.jpg  1234
  files/myvideo.mp4  456789
  ...
0

1 Answer 1

3

You can use command like:

unzip -lv myfiles.zip

Here is example output of this command:

# unzip -lv zz.zip
Archive:  zz.zip
 Length   Method    Size  Cmpr    Date    Time   CRC-32   Name
--------  ------  ------- ---- ---------- ----- --------  ----
      94  Defl:N       79  16% 02-18-2020 08:53 7be876f8  z1
     539  Defl:N      218  60% 02-18-2020 08:54 34711128  z2
    3234  Defl:N      250  92% 02-19-2020 14:06 46aba2a1  z3
--------          -------  ---                            -------
    3867              547  86%                            3 files
2
  • 1
    How can I get human-readable file sizes (e.g. 1KiB, 2MiB, 3GiB, etc.)?
    – Flux
    Feb 26, 2020 at 23:27
  • 1
    @Flux, I am afraid there is no such option in unzip this is managed automatically by the program Feb 27, 2020 at 6:40

Not the answer you're looking for? Browse other questions tagged .