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!
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
- Open the Files app and navigate to the directory where zip file is located.
- Locate the file which you want to unzip.
- Right click on the file and the context menu will appear with list of options.
- Select “Extract Here” option to unzip files into the present working directory or choose “Extract to...” for a different directory.
Extract zip file with Mint
- Steps are same as above. Just note that an "Extract to..." option is not provided with the default installation.
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. Archive Manager comes as a default installation with many Linux distros and is quick & easy way to decompress archives. Ark is another archive manager that ships as a default in a lot of distributions. 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. If unzip command is not installed on your system, then you'll need to do that first. The simplest option that will extract the contents to current directory: To change the target directory for extracted material, use -d option followed by the desired directory: To preview contents of zip file: If you don’t want to unzip the whole file, then add the specific files to extract at the end: The inverse of the above command. Unzip every file EXCEPT the ones specified after the -x modifier: Unzipping a password protected file: 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. To uncompress a file: Uncompress file to a different directory: Check out all the other parameters available with: 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: The output of the above should be filename.tar. Now to extract the tar file contents: You can combine the above two commands by adding a "z" option: Another compression format that you will often encounter is 7z. Install p7zip (if needed) To extract a 7z archive: 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) To extract a zipx archive:Extract zip file with Archive Manager
Extract zip file with Ark
How to unzip on Linux using terminal
Install unzip on Linux
sudo apt install unzip
Unzip on the Linux command line
unzip backup.zip
unzip backup.zip -d ./restore-directory
unzip -l backup.zip
unzip backup.zip file1 subdirectory/file2
unzip backup.zip -x file1 subdirectory/file2
unzip -p mypassword backup.zip
Unzip files on command line with unarchiver
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
unar backup.zip
unar -o ./output-directory backup.zip
unar -h
Unzip tar.gz files on command line
gunzip filename.tar.gz
tar xvf filename.tar
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
sudo apt-get install p7zip-full
7z e backup.7z
Unzip zipx files on command line
sudo apt-get install p7zip-full
7z e backup.zipx