Suppose, You’re a new Ubuntu Linux consumer. You want to to compress a folder named information in my dwelling listing. How do you zip unzip a folder in Ubuntu Linux?

On this tutorial, I would like to share how to compress archive recordsdata use the zip command. The zip is a compression and file packaging utility for Linux and Unix commands. A companion program known as unzip unpacks zip archives.

ZIP a folder in Ubuntu Linux utilizing the CLI

First, set up the zip command utilizing the apt command or apt-get command. Open the terminal and kind the next command: sudo apt set up zip unzip

How do I take advantage of the ZIP command to compress a folder?

To create a compressed archive named information.zip of information folder in the present listing, run: zip -r information.zip information/

Confirm file with the ls command: ls -l information.zip

You possibly can encrypt information.zip with a password bypassing the -e possibility: zip -r -e information.zip information/

ZIP command has many extra choices as follows:

Possibility Description
-f freshen: solely modified recordsdata
-u replace: solely modified or new recordsdata
-d delete entries in zipfile
-m transfer into zipfile (delete OS recordsdata)
-r recurse into directories
-j junk (don’t document) listing names
-0 retailer solely
-l convert LF to CR LF (-ll CR LF to LF)
-1 compress sooner
-9 compress higher
-q quiet operation
-v verbose operation/print model information
-c add one-line feedback
-z add zipfile remark
-@ learn names from stdin
-o make zipfile as previous as newest entry
-x exclude the next names
-i embody solely the next names
-F repair zipfile (-FF strive tougher)
-D don’t add listing entries
-A regulate self-extracting exe
-J junk zipfile prefix (unzipsfx)
-T take a look at zipfile integrity
-X eXclude eXtra file attributes
-y retailer symbolic hyperlinks because the hyperlink as an alternative of the referenced file
-e encrypt
-n don’t compress these suffixes
-h2 present extra assist

Compress a listing in Ubuntu Linux

The zip command syntax is as follows to compress a listing in Ubuntu Linux:

ZIP a folder in Ubuntu Linux utilizing the GUI technique

To entry and arrange the recordsdata you employ the “Information” app (file supervisor)”. Use the Information file supervisor to browse and arrange the recordsdata in your laptop. Open it. Choose folder title comparable to information and right-click the “Compress…“:

Password defending ZIP file

We will encrypt and password shield our zip file as follows: zip -r -e output.zip /path/to/folder/

We will additionally use and state passwords on the CLI to encrypt zip file entries: zip -r -e -P 'YOUR_PASSWORD_HERE' output.zip /path/to/folder/

Use unzip command to UNZIP a zip file

The syntax is: unzip {file.zip}

Use the next syntax if you need to extract/unzip to a specific vacation spot listing: unzip -d /dest/listing/ {file.zip}

For instance, unzip a zip file named grasp.zip utilizing the unzip command: unzip grasp.zip

To unzip a zip file named grasp.zip utilizing zip command to a /tmp/information/ listing: unzip -d /tmp/information/ grasp.zip

zip unzip a folder in Ubuntu Linux

The article was published on September 30, 2021 @ 4:20 PM

Leave a Comment