Installing unzip on linux

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

  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 with Mint

  1. 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.

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».
  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 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
  3. It will open the contents of the zip file into Ark. Select «Extract All > Extract To» from the Archive menu
    Extract To»>
  4. Select the directory you wish to extract the files to and then click «Extract»
Читайте также:  Windows remove vpn connection

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

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

Источник

How to Install Zip and Unzip in Linux

Zip is a command-line utility tool used for compressing files and folders. Compression of files & folders enables faster and more efficient transfer, storage, and emailing of files and folders. On the other hand, unzip is a utility tool that helps you decompress files and folders.

Benefits of zipping files:

  • Compressed/zipped files take up less disk space, leaving you with more space to work with.
  • Zipped files are easy to transfer including uploading, downloading, and attaching them on email.
  • You can easily decompress zipped files on Linux, Windows, and even mac.

In this topic, we focus on how you can install the zip and unzip utilities on various Linux distributions.

Читайте также:  Wifi адаптер для linux mint
On this page:

Let’s now see how you can install these useful command-line utilities.

How to Install Zip/Unzip in Debian/Ubuntu/Mint

For Debian-based distributions, install the zip utility by running the command.

After installation, you can confirm the version of zip installed using the command.

For the unzip utility, execute a similar command as shown.

Again, just like zip, you can confirm the version of the unzip utility installed by running.

How to Install Zip/Unzip in RedHa/CentOS/Fedora

Just like on Debian distributions, installing zip and unzip utilities on Redhat distros is quite simple.

To install zip, simply execute:

For the unzip utility, install it by running:

How to Install Zip/Unzip in Arch/Manjaro Linux

For Arch-based distros, run:

For the unzip utility,

How to Install Zip/Unzip in OpenSUSE

On OpenSUSE, run the command below to install zip.

And to install unzip, execute.

For more information, read our article that shows how to create and extract a zip files in Linux.

Conclusion

For newer versions of Linux distros such as Ubuntu 20.04 and CentOS 8, the zip and unzip utilities already come pre-installed and you are good to go.

We covered how to install zip and unzip command-line tools on various Linux distributions and the benefits that come with compressing files.

If You Appreciate What We Do Here On TecMint, You Should Consider:

TecMint is the fastest growing and most trusted community site for any kind of Linux Articles, Guides and Books on the web. Millions of people visit TecMint! to search or browse the thousands of published articles available FREELY to all.

If you like what you are reading, please consider buying us a coffee ( or 2 ) as a token of appreciation.

We are thankful for your never ending support.

Источник

How to unzip a zip file using the Linux and Unix bash shell terminal

Use unzip command to unzip a zip file

The syntax is:
unzip
Use the following syntax if you want to extract/unzip to a particular destination directory:
unzip -d /dest/directory/
For example, unzip a zip file named master.zip using zip command:
unzip master.zip
To unzip a zip file named master.zip using zip command to a /tmp/data/ directory:
unzip -d /tmp/data/ master.zip
Sample session:

Fig.02: How to unzip a zip file from the Terminal using unzip command

A note about bash: unzip: command not found

If the unzip command NOT installed on your Linux or Unix box, then run any one of the following commands as per your Linux distribution to install the unzip command.

Make sure you run the following command as the root user. For instance:
sudo command
OR
su —

Installing unzip on Debian/Ubuntu Linux

Use the apt-get command or apt command to install unzip command:
sudo apt-get install unzip
OR
sudo apt install unzip

Install unzip on Arch Linux

Use the pacman command to install unzip command:
pacman -S unzip

CentOS/RHEL/Scientific/Oracle Linux install unzip command

Use the yum command or dnf command to install unzip command:
yum install unzip

  • No ads and tracking
  • In-depth guides for developers and sysadmins at Opensourceflare✨
  • Join my Patreon to support independent content creators and start reading latest guides:
    • How to set up Redis sentinel cluster on Ubuntu or Debian Linux
    • How To Set Up SSH Keys With YubiKey as two-factor authentication (U2F/FIDO2)
    • How to set up Mariadb Galera cluster on Ubuntu or Debian Linux
    • A podman tutorial for beginners – part I (run Linux containers without Docker and in daemonless mode)
    • How to protect Linux against rogue USB devices using USBGuard

Join Patreon

Fedora Linux install unzip

Use the dnf command to install unzip command:
dnf install unzip

Installing unzip on Suse/OpenSUSE Linux

Use the zypper command to install unzip command:
zypper install unzip

FreeBSD Unix install unzip

To install the unzip port, run:
# cd /usr/ports/archivers/unzip/ && make install clean
To add the package rung pkg command:
# pkg install unzip

Читайте также:  Необходимые разделы для linux

OpenBSD Unix install unzip

macOS Unix install unzip CLI

Let us install Homebrew on macOS. Once installed type the following brew command to install unzip utility:
$ brew install unzip

Use tar command to unzip a zip file

The syntax is:
tar xvf
tar -xvf
Use the following syntax if you want to extract/unzip to a particular destination directory:
tar xvf -C /dest/directory/
tar -xvf -C /dest/directory/
For example, unzip a zip file named master.zip using tar command:
tar xvf master.zip
To unzip a zip file named master.zip using tar command to a /tmp/data/ directory:
tar xvf master.zip -C /tmp/data/
ls -l /tmp/data/
cd /tmp/data/
ls -l
Sample session:

Fig.01: How to use a tar command to unzip a file on Linux/Unix-like terminal

🐧 Get the latest tutorials on Linux, Open Source & DevOps via

Category List of Unix and Linux commands
Documentation help • mandb • man • pinfo
Disk space analyzers df • duf • ncdu • pydf
File Management cat • cp • less • mkdir • more • tree
Firewall Alpine Awall • CentOS 8 • OpenSUSE • RHEL 8 • Ubuntu 16.04 • Ubuntu 18.04 • Ubuntu 20.04
Linux Desktop Apps Skype • Spotify • VLC 3
Modern utilities bat • exa
Network Utilities NetHogs • dig • host • ip • nmap
OpenVPN CentOS 7 • CentOS 8 • Debian 10 • Debian 8/9 • Ubuntu 18.04 • Ubuntu 20.04
Package Manager apk • apt
Processes Management bg • chroot • cron • disown • fg • glances • gtop • jobs • killall • kill • pidof • pstree • pwdx • time • vtop
Searching ag • grep • whereis • which
Shell builtins compgen • echo • printf
Text processing cut • rev
User Information groups • id • lastcomm • last • lid/libuser-lid • logname • members • users • whoami • who • w
WireGuard VPN Alpine • CentOS 8 • Debian 10 • Firewall • Ubuntu 20.04

Comments on this entry are closed.

I’d just like to interject for a moment. What you’re referring to as Linux, is in fact, GNU/Linux, or as I’ve recently taken to calling it, GNU plus Linux. Linux is not an operating system unto itself, but rather another free component of a fully functioning GNU system made useful by the GNU corelibs, shell utilities and vital system components comprising a full OS as defined by POSIX.

Many computer users run a modified version of the GNU system every day, without realizing it. Through a peculiar turn of events, the version of GNU which is widely used today is often called “Linux”, and many of its users are not aware that it is basically the GNU system, developed by the GNU Project.

There really is a Linux, and these people are using it, but it is just a part of the system they use. Linux is the kernel: the program in the system that allocates the machine’s resources to the other programs that you run. The kernel is an essential part of an operating system, but useless by itself; it can only function in the context of a complete operating system. Linux is normally used in combination with the GNU operating system: the whole system is basically GNU with Linux added, or GNU/Linux. All the so-called “Linux” distributions are really distributions of GNU/Linux.

unzip worked for a zip file, tar xvf did not work for me…

error:
tar: This does not look like a tar archive
tar: Skipping to next header
tar: Exiting with failure status due to previous errors

You cannot use tar to extract a zip file. I demand that you fix this web page.

Источник

Оцените статью