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
Step 1. Locate the archive to extract
For example, if it is stored in the "Documents" folder, you will need to access it.
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
Step 3. Enter the Linux Menu menu
It is located at the bottom left of the screen.
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
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
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
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
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
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
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.