Hack 47. Validate a zip archive

Sometime you may want to validate a zip archive without extracting it. To test the validity of the zip file, pass option –t as shown below.

# unzip -t var-log.zip

     Archive:  var-log.zip
    testing: var/log/acpid            OK
    testing: var/log/anaconda.log     OK
    testing: var/log/anaconda.syslog   OK


    testing: var/log/wtmp             OK
    testing: var/log/wtmp.1           OK
    testing: var/log/Xorg.0.log       OK

No errors detected in compressed data of var-log.zip.