How to Unzip Zip Files in Linux: 10 Steps

Table of contents:

How to Unzip Zip Files in Linux: 10 Steps
How to Unzip Zip Files in Linux: 10 Steps
Anonim

This article shows you how to unzip a ZIP file, i.e. extract all the files and folders it contains, on a Linux system. To do this, the "Terminal" window is used, which is the Linux counterpart of the Windows "Command Prompt".

Steps

Part 1 of 2: Unzip a Folder

Unzip Files in Linux Step 1
Unzip Files in Linux Step 1

Step 1. Locate the archive to extract

For example, if it is stored in the "Documents" folder, you will need to access it.

Unzip Files in Linux Step 2
Unzip Files in Linux Step 2

Step 2. Make a note of the full name of the ZIP archive you wish to extract

To execute the command you need to type the exact name of the file to be decompressed as indicated.

Remember that spaces and lowercase and uppercase letters do matter when executing a Linux command, so these are aspects you can't overlook

Unzip Files in Linux Step 3
Unzip Files in Linux Step 3

Step 3. Enter the Linux Menu menu

It is located at the bottom left of the screen.

Unzip Files in Linux Step 4
Unzip Files in Linux Step 4

Step 4. Select the "Terminal" icon

It is characterized by a black square, inside which there is the classic command line prompt: "> _". The "Terminal" icon may be located either in the left sidebar of the "Menu" menu or in the program list displayed within it.

Alternatively, you can search for the "Terminal" program using the search bar at the top of the "Menu" window by typing the keyword terminal

Unzip Files in Linux Step 5
Unzip Files in Linux Step 5

Step 5. Type the command

unzip [filename].zip

inside the "Terminal" window that appeared.

Replace the "[filename]" parameter with the exact name of the ZIP file you want to extract.

  • For example, if you need to unzip the "BaNaNa" file, you will need to use the command

    unzip BaNaNa.zip

Unzip Files in Linux Step 6
Unzip Files in Linux Step 6

Step 6. Press the Enter key

In this way the command entered will be executed and the indicated file will be decompressed.

Part 2 of 2: Unzip All ZIP Files Present in a Single Folder

Unzip Files in Linux Step 7
Unzip Files in Linux Step 7

Step 1. Go to the directory where the files to extract are stored

To do this, simply open the folder where there are the ZIP files to be processed.

Be careful because running the "unzip" command inside a folder containing multiple ZIP files could cause accidental decompression of archives that should not actually be extracted

Unzip Files in Linux Step 8
Unzip Files in Linux Step 8

Step 2. Type the command pwd into the "Terminal" window and press the Enter key

In this way the "pwd" command will be executed which will show on the screen the name of the current directory in use.

This step is only to verify that you are in the correct directory before proceeding to extract the files

Unzip Files in Linux Step 9
Unzip Files in Linux Step 9

Step 3. Type the command

unzip "*.zip"

inside the "Terminal" window.

This command will extract the contents of all files with the ".zip" extension stored in the current directory.

The quotation marks that enclose the *.zip parameter of the command in question are used to limit its execution to the current directory

Unzip Files in Linux Step 10
Unzip Files in Linux Step 10

Step 4. Press the Enter key

In this way the command will be executed and all the ZIP files present in the current directory will be automatically decompressed. At the end of the execution you will be able to view the contents of the processed files by accessing the respective subfolders.

  • If the indicated command fails, try using the following syntax:

    unzip / * zip

Advice

Some Linux interfaces have a "command line" accessible directly from the desktop via a text field located at the top of the screen. This tool works exactly like a normal "Terminal" window

Warnings

  • The execution of the "unzip *.zip" command, when you are inside the wrong directory, will cause the extraction of the contents of all the ZIP archives present inside the latter, which will therefore be crowded with files and folders in no particular order.
  • If you have installed a custom Linux user interface, the path to use in order to open a "Terminal" window may be different from the one indicated in this article.

Recommended: