Back to how-to guides

How To Unzip Files On Linux

So you’ve been sent a .zip file as an attachment and now you’re stuck figuring how to extract it’s content? Or some such! Luckily you’ve stumbled upon the right place, as at ezyZip we eat zip files for breakfast! Linux offers various solutions to uncompressing zip files, depending on your configuration and variant.

Below we outline some common methods to unzipping files on the Linux environment.

Quick Tip!

Looking to quickly open zip archive without hassle? Use ezyZip! 😊
It runs in the browser, so no need to install any extra software. Just navigate to the unzip page and follow the given instructions. It's FREE!

Zip Extractor Online

Using the GUI to unzip files on Linux

The simplest approach is to use the GUI. Below we show the steps involved when using the default desktop environment that comes with each linux distribution. If you are using a custom setup, then these steps might not apply. Use the command line unzip options if you are stuck!

Extract zip file with Ubuntu / Debian

  1. Open the Files app and navigate to the directory where zip file is located.
  2. Locate the file which you want to unzip.
  3. Right click on the file and the context menu will appear with list of options.
  4. Select “Extract Here” option to unzip files into the present working directory or choose “Extract to...” for a different directory.
    Extract zip file in ubuntu linux GUI

Extract zip file with Mint

  1. Steps are same as above. Just note that an "Extract to..." option is not provided with the default installation.
    Extract zip file in mint linux GUI

That’s it, you have successfully unzipped the file. Optionally you could also use the Gnome Archive Mananger, which offers more advanced options and support for other file types.

Other Linux unzip applications

There is a myriad of dedicated archive management applications that can be utilised for unzipping files. Some are packaged with the distribution and others can be installed separately.

Extract zip file with Archive Manager

Archive Manager comes as a default installation with many Linux distros and is quick & easy way to decompress archives.

  1. Open the Files app and navigate to the directory where zip file is located.
  2. Right click the file and select "Open With Archive Manager".
    Open zip file with archive mananger
  3. Archive Manager will open and display the contents of the zip file. Click "Extract" on the menu bar to uncompress the contents into the current directory.
    Extract zip file with Archive Manager

Extract zip file with Ark

Ark is another archive manager that ships as a default in a lot of distributions.

  1. Open Ark. It will initially say "No archive loaded"
  2. Select "Open..." from the top Archive menu Open zip file with Ark
  3. It will open the contents of the zip file into Ark. Select "Extract All > Extract To" from the Archive menu
    Extract All with Ark
  4. Select the directory you wish to extract the files to and then click "Extract"
    Extract all files with Ark

How to unzip on Linux using terminal

If you want to work like a pro and desire more powerful features, you have to move towards command line interface. Fire up your terminal and run one of the following commands to complete your desired task. The examples assume you have a filename called backup.zip.

Install unzip on Linux

If unzip command is not installed on your system, then you'll need to do that first.
sudo apt install unzip

Unzip on the Linux command line

The simplest option that will extract the contents to current directory:
unzip backup.zip

To change the target directory for extracted material, use -d option followed by the desired directory:
unzip backup.zip -d ./restore-directory

To preview contents of zip file:
unzip -l backup.zip

If you don’t want to unzip the whole file, then add the specific files to extract at the end:
unzip backup.zip file1 subdirectory/file2

The inverse of the above command. Unzip every file EXCEPT the ones specified after the -x modifier:
unzip backup.zip -x file1 subdirectory/file2

Unzipping a password protected file:
unzip -p mypassword backup.zip

Unzip files on command line with unarchiver

A great free set of unarchiving command line utilities are supplied by the Unarchiver. There is a GUI too but that is currently only offered to MacOS users.

The best part about these utilities is that they support dozens of other file formats (e.g. rar, 7z, arj etc...) and the command line syntax is the same for all of them.

Install unarchiver

sudo apt-get install unar

Unarchive files

To uncompress a file:
unar backup.zip

Uncompress file to a different directory:
unar -o ./output-directory backup.zip

Check out all the other parameters available with:
unar -h

Unzip tar.gz files on command line

Linux and other unix variants commonly use tar and gz to package collection of files into a single package (e.g. software packages). To use the GUI for opening tar.gz files, follow the zip file instructions above. The command line options however are slightly different:

First uncompress the gz file:
gunzip filename.tar.gz

The output of the above should be filename.tar. Now to extract the tar file contents:
tar xvf filename.tar

You can combine the above two commands by adding a "z" option:
tar zxvf filename.tar.gz

Alternately, you could use ezyZip to extract tar.gz files or open tar file individually.

Unzip 7z files on command line

Another compression format that you will often encounter is 7z.

Install p7zip (if needed)
sudo apt-get install p7zip-full

To extract a 7z archive:
7z e backup.7z

Unzip zipx files on command line

The zipx file format is commonly associated with WinZip and not available for linux users. However fear not, you can use the 7zip utility to open zipx files in linux!

Install p7zip (if needed)
sudo apt-get install p7zip-full

To extract a zipx archive:
7z e backup.zipx