Author:
Florence Bailey
Date Of Creation:
25 March 2021
Update Date:
1 July 2024
![How to Zip and Unzip Directories on Linux](https://i.ytimg.com/vi/_p2iq6wcLPI/hqdefault.jpg)
Content
- Steps
- Part 1 of 2: How to unpack a single archive
- Part 2 of 2: How to unpack multiple archives
- Tips
- Warnings
This article will show you how to unpack an archive on Linux using Terminal.
Steps
Part 1 of 2: How to unpack a single archive
1 Find the archive. For example, if it's in the Documents folder, open that folder.
2 Remember or write down the name of the archive. In the terminal, the name of the archive must be entered without errors.
- Don't forget capital letters and spaces.
3 Click on Menu. It's in the lower left corner of the screen.
4 Click on the Terminal icon. This icon looks like a black rectangle with white "> _" symbols. The icon will appear in the left pane of the Menu window or in the list of programs that you find in the Menu window.
- You can also find the terminal by clicking on the search bar at the top of the Menu window and then typing terminal.
5 In Terminal enter unzip filename.zip. Replace "filename" with the name of the archive.
- For example, if the archive is named "BaNaNa", in the Terminal enter unzip BaNaNa.zip.
6 Click on ↵ Enter. The archive will be unpacked.
Part 2 of 2: How to unpack multiple archives
1 Go to the archive folder. To do this, simply open the folder where the archives are stored.
- If you run the "unzip" command from the wrong directory, the archives will be unpacked, some of which do not need to be unpacked.
2 In terminal enter pwd and press ↵ Enter. The name of the current directory will be displayed on the screen.
- This must be done to make sure you are in the correct directory.
3 In Terminal enter unzip " *. zip". The screen will display all .zip files (i.e. archives) that are present in the current directory.
- Quotes around *. zip tell the command to search only in the current directory.
4 Click on ↵ Enter. Archives stored in the current directory will be unpacked; the contents of the archives can be found in the same folder as the archives themselves.
- If the command doesn't work, enter unzip / * zip in a terminal.
Tips
- Some Linux distributions have a "Command Line" text box at the top of the desktop. This line functions the same as Terminal.
Warnings
- If you run the command "unzip *. Zip" from the wrong directory, all archives in that directory will be unpacked, which will at least clutter this directory.
- If you've changed the default interface of your Linux distribution, the steps to open Terminal may differ from the steps in this article.