Debian

How to Unzip into a Folder in Debian

In Debian, ZIP is an archive file format, that contains one or more compressed files in a single file. This is the ideal way of combining related files together and making the larger files small without compromising the quality of the content. You can share multiple files in a single folder via the ZIP file and send more data at a faster speed.

unzip is the command line utility for unzipping files, this tool extracts the content in the current directory of your system by default. How do I extract the packages.zip into the specific directory? Let’s explore this in detail in the below guide.

How to Unzip into a Folder

There are two ways to unzip a file into a folder in Debian:

Method 1: Unzip into a Folder Via Command Line

The unzip is a command-line utility that is used to unzip files into a folder in Debian. The utility is preinstalled on the Debian system, however, in case you uninstall it by mistake, you can run the following command again to reinstall it on your system.

sudo apt install unzip

To unzip a file into a folder in Debian using the unzip command, you must use the -d flag with the command as it will take the path argument of a folder where the files will be placed. The general syntax to unzip into a folder in Debian is given below:

unzip path/to/file -d path/to/folder

Here in the below example, I have unzipped the samplefiles.zip to the directory with the name “myfiles”.

unzip samplefiles.zip -d myfiles

Verify the content in the myfiles directory using the “ls” command after executing the unzip command:

In this way, you can unzip any file into a folder of your choice using the unzip command-line utility.

Method 2: Unzip into a Folder Via GUI

The other easiest way to unzip into a folder is via the GUI. Head to the directory where the zip file is present and right-click on the file and click on Extract to:

Next, select the folder of your choice where you want to unzip the files:

Verify the files by opening the selected directory:

Bottom Line

Unzipping the file in Debian is easy and you can do so by using terminal or GUI. For the terminal method, you must install the unzip package and follow the unzip <zip files> -d <folder> command syntax to unzip a file into a folder. In GUI, there is an option Extract to once you right-click on the zip file. This option will unzip the files into the specific directory of your choice.

About the author

Zainab Rehman

I'm an author by profession. My interest in the internet world motivates me to write for Linux Hint and I'm here to share my knowledge with others.