Linux – Create and extract zip

Folder-Archive-zip-iconZip

Probably the most used archiving format for pc users.
To compress a folder in Linux:

zip -r archive.zip /home/Jon/files_to_archive
This example assume we are creating a zip file called archive.zip, and the files (or directory) we compress is in Jons home folder.
The -r switch means recursive, and is including all sub directories in the files_to_archive folder.
So another zip example. Here we are going to zip all files in current directory:

zip current_directory.zip *
The zip files can of course be called whatever you like

Unzip

To unzip the an zip fil to current directory (any directories in zip files will be created):
unzip archive.zip

 

Happy zipping!

July 7th, 2014 by