Last Updated: February 25, 2016
·
366
· sativaware

Linix: Zipping the contents of a directory recursively

Zipping the contents of a directory recursively

zip -9 -r <zip file> <folder name>

Example:

Recursivly zip the contents of the ~/home/documents directory into a zip file named documents.zip

zip -9 -r documents.zip ~/home/documents

Zipping a single file

zip -9 <zip file> <filename>

Example:

Zip a file called my-backup.sql into a zip file named my-backup.zip

zip -9 my-backup.zip my-backup.sql

Unzip

apt-get install unzip

unzip documents.zip