Little Girl's Mostly Linux Blog

Zip

Zip

This page was last updated on July 18, 2009.

Table of Contents

Zip a file or folder

  • Syntax:
  • zip -rT destinationfilename /sourcefileorfolder
    • Example:
    • zip -rT zipme.zip /home/username/Desktop/zipme

Test a zip file with zip

  • Syntax:
  • zip -T filename.zip
    • Example:
    • zip -T test1.zip
    • Result:
    • test of test1.zip OK

Test a zip file with unzip

  • Syntax:
  • unzip -tq filename.zip
    • Example:
    • unzip -tq test1.zip 
    • Result:
    • No errors detected in compressed data of test1.zip.

Test all zip files in current directory with zip

  • Syntax:
  • zip -T *.zip
    • Example:
    • zip -T *.zip
    • Result:
    • updating: test2.zip (stored 0%)
      test of test1.zip OK
      

Test all zip files in current directory with unzip

  • Syntax:
  • unzip -tq \*.zip
    • Example:
    • unzip -tq \*.zip 
    • Result:
    • No errors detected in compressed data of test1.zip.
      No errors detected in compressed data of test2.zip.
      
      2 archives were successfully processed.
      

Unzip a file

unzip filename.zip

Unzip all files in current directory

find *.zip -exec unzip {} \;



Obligatory Happy Ending

And they all lived happily ever after. The end.

Leave a Comment »

No comments yet.

RSS feed for comments on this post. TrackBack URI

Comment:

Create a free website or blog at WordPress.com.