How to get md5sum of a file inside a zip, without extracting the zip

1.4k Views Asked by At

Is there any way to get the md5sum of a file inside a zip file, without extracting the zip ?. I have a zip file containing directories plugins, p2 and features where plugins directory contains lot of jar files. How can I get the md5sum of a given jar file inside the plugins directory ?. Thanks in advance.

1

There are 1 best solutions below

3
arunkumar A On

You can get the md5sum using below command

unzip -Z1 archive.zip | while read -r file; do
    echo -n "$file: "
    unzip -p archive.zip "$file" | md5sum
done