Today we will learn how to unzip a file on Ubuntu. Now we will discuss how to zip and unzip files using the Terminal and GUI methods on Ubuntu. Stay with us!
How to unzip a zip file on ubuntu using a terminal?
- Open your Terminal window by pressing Ctrl + Alt + T or go to the command box at the top left of your screen and click the “Open in Putty” option.
- Once you’ve done this, you’ll be greeted with your username, which you originally entered into WinSCP to connect.
- Now you need to enter your password. If you forget your password, you can easily find it back in your server details.
- Copy your password and return to the terminal window.
- Right-click to paste the password and then press Enter.
- Now, you will log into your server via SSH.
- By default, the unzip command is installed on your system, but if it isn’t, you can install it with the command below:
$ sudo apt install unzip

- Once you type it, press enter and your server will start installing “unzip”.
- Once it’s installed, you’re now ready to unzip your file by entering the following command:
$ unzip [FileName].zip

- Once you enter the command and replace “filename” with the name of your zip file, you press enter and your server will start unzipping it.
- Now, check if it is complete.
- To do this, you’ll refresh your service directory and see all the files you unzipped.
- now You can change directories and remove the unzipped files using the following command:
$ cd [Directory-Name]
How to unzip a zip file to a different directory on your ubuntu Linux system?
To unzip a file to a different directory, you should use the following syntax:
$ unzip [FileName].zip -d /[Directory-Path]
A zip file contains a set of files and their descriptions. When you unzip such a file, you can see all the information about each containment. To avoid this, you can use the “-q” flag in the syntax above:
$ unzip -q [FileName].zip
You can also extract the files you need during the unzip process and discard the rest. To do this, you can use the “-x” flag in the above syntax when considering spaces in file names:
$ unzip [FileName].zip -x “*Filename1*” “*Filename2*”
How to unzip a zip file without overwriting the files on your system?
To avoid overwriting already extracted files, you should use the “-n” flag on the command line:
$ unzip -n [FileName].zip
How to unzip multiple files in a directory?
To unzip multiple files in one directory, you should use the following command:
$ unzip ‘*.zip’
How to find the number of zip files in a directory?
$ ls [directory_name]
How to unzip a zip file in Ubuntu using GUI?
To unzip a file on Ubuntu systems, you don’t always need to go to the Terminal. If you are using the GNOME desktop, you can perform this process through the graphical user interface (GUI) by following these steps:
- Open the file manager.
- Go to the folder where your zip file is saved.
- Right-click on the file.
- Select the “Extract here” option.
- You may also see an “Extract to” option, which helps you specify the folder you want to extract the files.
How to zip multiple files in Ubuntu?
To zip multiple files on an Ubuntu server, you should compile all the files you want to zip into a single folder. Then, you should follow these steps:
- Open your SSH terminal.
- Install “zip” by typing the following command:
$ apt install zip
- Press Enter.
- Now, “zip” will start installing on your server.
- Once that’s done, you’re ready to enter the zip command:
$ zip –r zip [FileName].zip the [FolderName]
- By zip File Name, we mean the name of the new file you are creating.
- By folder name, we mean the folder we want to zip.
- Once you type the above command, press enter.
- Now, your server will start zipping the file entered in the command.
Conclusion
Here, you have learned how to unzip a zip file in Ubuntu and re-zip it if needed. If you have questions about this article or anything related to Linux systems, don’t hesitate to ask us.



