facebook youtube pinterest twitter reddit whatsapp instagram

Installing and Using (Zip & Unzip) In Ubuntu

Zip is a compression and file packaging utility, this is useful for packaging a set of files for distribution; for archiving files; and for saving disk space by temporarily
compressing unused files or directories.

Advantages of zipping:

  • You save storage space, leaving you with more space to work with
  • It is a compact and easy to transfer zip file, compared to unzip files
  • Zipping allows you to encrypt private data, helpful when sending such data over the internet.

Installing Zip in Ubuntu

sudo apt install zip

You can confirm zip version by running zip -v

Zipping File and Directories

To create a Zip archive in a specific directory the user needs to have write permissions on that directory. Note that, Zip doesn't support GNU/Linux-style ownership information. The extracted files are owned by the user that runs the command.

zip archive.zip filename1 filename2 filename3

The above command would compress the files, and store it in archive.zip

To zip a directory, you use the -r option:

zip -r archive.zip directory_name

You can also add multiple directory, and files, just do not forget the -r option.

Intsalling Installing Unzip in Ubuntu

 sudo apt install unzip

Likewise zip, you can also check the version by using unzip -v

Unzipping Files

When you use the unzip command without any option, it would extracts all files from the specified ZIP archive to the current directory, e.g

unzip classicpress.zip

Unzip a ZIP File to a Different Directory

To unzip a ZIP file to a specific directory, use the -d option:

unzip file.zip -d /path/to/directory

Related Post(s)

  • Send Mail with Attachment Using Mutt in GNU/Linux

    Mutt is a powerful text-based mail client for Unix/Linux operating systems. It features color support, message threading, MIME support...

  • Using Pageant To Automatically Authenticate SSH key in Putty

    I can't count how many times I have typed my ssh key passphrase whenever my ssh connection times out, it is so annoying and repetitive. Well, thanks to the putty pageant, you can do that seamlessly.

  • Installing WP-CLI In a GNU/Linux Server

    WP-CLI is a command-line interface for WordPress. It can also be used with ClassicPress, as they are no differences in their usage, maybe just minimal if you are updating or downloading new ClassicPr

  • Installing and Running Rclone Mount As a Windows Service

    I previously wrote a guide on how to mount and unmount rclone in Linux, in this guide, I’ll walk you through on how to do the same on a windows system. Step 1: Download Rclone First, go to rclone d

  • How To Send Mail To Multiple Addresses Using (mailx)

    In this guide, you'll learn a couple of ways you can send mail to multiple addresses using mailx. mailx is a utility program for sending and receiving mail. I assume you already have mailx command, i

  • Mounting and Unmounting Cloud Storage With (Rclone) in GNU/Linux

    Ever wondered if you could mount your preferred cloud storage as a virtual drive on your system? Thanks to Rclone, you can mount and access different kinds of cloud storage from a file manager, I'll