Zip Files in Ubuntu CLI

If you want to work with zip files in Ubuntu command line interface, you will need these commands: zip and unzip.

Zip

To install zip if you don’t already have it, do this

sudo apt-get install zip

The simplest way to create a zip file (archive) is

zip myzipfile.zip file1 file2 file3 …

Where myzipfile.zip is the file (zip archive) you are creating and file1, file2, file3, and so on, are the files you are including in that archive. So let’s say you need to create a zip file of your resumé which is in different file formats, you would something like

zip myresume.zip resume.odt resume.pdf resume.doc resume.txt

Unzip

To unzip files, you need to have a command called unzip. To install unzip if you don’t already have it, do this

sudo apt-get install unzip

The simplest way to extract all files from a zip archive is

unzip myzipfile.zip

Where myzipfile.zip is the file (zip archive) you are unzipping. So let’s say you need to extract (unzip) a zip file of your resumé which contains different files, you would something like

unzip myresume.zip

Bepaalde map/bestand uit een zip uitpakken.

Zoek eerst de naam van het bestand met

unzip -l myresume.zip "path/naar/bestand*"

Daarna uitpakken met

unzip myresume.zip "path/naar/bestand*"

Laat een reactie achter

Het e-mailadres wordt niet gepubliceerd. Vereiste velden zijn gemarkeerd met *