Zip / Unzip files using the command line

Add a single file to zip

#!/bin/bash

zip [ zip name ].zip [ filename ].jpg

Add file, to an already build archive:

#!/bin/bash

zip -g [ zip name ].zip folder/file

Recursively zip multiple folders

#!/bin/bash

zip -r [ zip name ].zip folder/

In order to unzip your archive use

#!/bin/bash

unzip [ zip name ].zip

 

Top