Hack 47. Validate a zip archive

by Ramesh

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.

  1. # unzip -t var-log.zip
  2.  
  3. Archive: var-log.zip
  4. testing: var/log/acpid OK
  5. testing: var/log/anaconda.log OK
  6. testing: var/log/anaconda.syslog OK
  7.  
  8. skip...
  9.  
  10. testing: var/log/wtmp OK
  11. testing: var/log/wtmp.1 OK
  12. testing: var/log/Xorg.0.log OK
  13.  
  14. No errors detected in compressed data of var-log.zip.