Zip
This page was last updated on July 18, 2009.
Table of Contents
- Zip a file or folder
- Test a zip file with zip
- Test a zip file with unzip
- Test all zip files in current directory with zip
- Test all zip files in current directory with unzip
- Unzip a file
- Unzip all files in current directory
- Obligatory Happy Ending
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
test of test1.zip OK
Test a zip file with unzip
- Syntax:
unzip -tq filename.zip
- Example:
unzip -tq test1.zip
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
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
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.
Comment: