Skip to content

1.8.1 Zips

Tomato6966 edited this page Dec 27, 2022 · 1 revision

First install deps

apt-get install zip unzip

Creating a .zip

To zip a folder do this:

zip -r Output_MyFolder.zip ./MyFolder/

you can even zip multiple files / folders together:

zip -r Output_MyFolder.zip ./MyFolder/ /home/var/www ./file1.txt ./file2.txt ./file3.txt

How to zip with password?

Add the -e flag:

zip -er Output_MyFolder.zip ./MyFolder/

Zip all files of a specific type:

zip -0 archivename *.mp3

The above command ‘-0’ shows the compression level. When you use compression level ‘0’, the file will be stored in the archive without any compression. The compressions level varies from ‘-0 to -9’. The ‘-6’ is the default compression level, and when you use ‘-9’ it will force the zip command to adopt the optimized compression for all files.

Unzip Folders

unzip Archive.zip
Clone this wiki locally