Ubuntu and other Linux desktops generally ship with powerful file managers. Unlike some other operating systems, Ubuntu can handle zip and tar archives and other packaging formats out of the box. This is handy since you’ll be dealing with a lot of archives and zip files on Linux. Zipping and unzipping files is a common practice in almost any field of work even if you’re a student. Ubuntu makes life much easier. You can zip and unzip files in Ubuntu Linux using the command line. If you’re uncomfortable with that, a simple right-click is also very useful.

Besides, several commands can help you do amazing things. Do not forget to check out these 20 useful commands for Ubuntu.

Table of Content

Steps to Zip & Unzip Files using Command Line

Zipping and unzipping files is easy on Ubuntu because the necessary tools are already pre-installed. If for some reason, the zip unzip tool isn’t installed, you can run the following command in a terminal to manually install it.

sudo apt install zip unzip

You can also use the command if you’re unsure. If the tool is already installed, no changes will be made to your system and nothing will be installed.

Zip files in Ubuntu Using Command

To zip a file, first, make sure all the files are in the same location where your terminal window is open. After that, you need a single command containing the name of the zip file and the files you want to zip.

files on desktop

For example have 3 files on the desktop named filename1, filename2, and filename3. To zip them, open a terminal window in the desktop folder.

zip files in Ubuntu

zip zipfilename filename1 filename2 filename3 filename4 ... filenameN

Make sure you enter all the filenames correctly. You should be able to see the zip file with the file explorer now if you wish.

zipped files on desktop

You can also zip folders or a mix of files and folders using the same command. Instead of the filename you have to use the folder name.

Unzip files in Ubuntu Using Command

Similarly, you can unzip any zip file by simply passing its name along with the unzip command. The files are extracted into the same location where the zip file is located. For this example, we had earlier created a technastic.zip file containing three files filename1, filename2, and filename3. So the unzip command would be as follows.

unzip technastic.zip

unzip files in Ubuntu Linux

The zip and unzip command remains the same across any other Linux distro. The only requirement is to have the zip unzip command line tool on your Linux system.

5 Ways to Restore Deleted Contacts on Android

Steps to Zip & Unzip Files from File Explorer (GUI)

Zipping and unzipping files via the command line is easy on Ubuntu. However, doing so via the default Nautilus file manager is even easier. Alternatively, you can try Dolphin File Manager on Ubuntu.

Zip files

compress files ubuntu

Open the file explorer and head to the location of the files you want to zip. Next, select all the files and then right-click on one of them. In the context menu, click the Compress… option.

create zip archive

As soon as you click it, a popup dialog will open up. It will allow you to select from the three most popular archive formats used by Linux users. zip is selected by default so you don’t need to worry about that. It will also let you give a name to the zip file. Once you’ve given a desirable name to the zip file click the Create button.

Unzip files

As usual, use the file explorer to navigate to the zip file you want to unzip. Right-click on it and select either the Extract Here or Extract to… option. Extract Here will create a folder with the name of the zip file, in the same location as the zip file. All the files inside the zip will then be extracted in this folder. If you choose Extract to… you will be asked to navigate to a location where you want the files extracted.

unzip or extract file in ubuntu

You can also unzip several archives at once by selecting all of them before right-clicking on one of them. The method to zip or unzip an archive remains the same for any other archive format including .tar, .tar.xz, .7zip, and even .rar files.

Having learned to zip and unzip files using a command line and file explorer, you should also check out our guide on changing Ubunto desktop wallpapers automatically.

Was this Article helpful?
YesNo