The unzip command in Linux is a straightforward tool for extracting files from ZIP archives. ZIP files are widely used across different operating systems due to their simplicity and compatibility. In this guide, you’ll learn how to unzip files in Linux through both command-line and graphical interfaces.
Check if Unzip is Installed
Before you begin, verify if the unzip utility is installed on your system. Open your terminal and run:
unzip --version
If the output shows version details, you’re good to go. If it returns an error stating the command is not found, you’ll need to install it.
For Ubuntu or Debian-based distributions, use the following command:
sudo apt install unzip
For Fedora, AlmaLinux, Rocky Linux, or CentOS, install unzip using:
sudo dnf install unzip
Join readers who trust AllThings.How
Add us as a preferred source on Google so our practical guides show up first next time you search.
Add to Google Preferences →Method 1: Unzip Files Using the Linux Terminal
The most straightforward method to unzip files in Linux is through the command-line interface.
cd ~/Downloads
unzip example.zip
This command extracts all files into the current directory, which may clutter it if the archive contains many files.
Extract ZIP Files to a Specific Directory
To keep your files organized, it’s better to extract them into a specific directory. If the specified directory doesn’t exist, it will be created automatically:
unzip example.zip -d extracted_files
This extracts all contents of example.zip into the extracted_files directory.
Preview ZIP File Contents Without Extracting
Sometimes, you may want to see what’s inside a ZIP file without extracting it. Use the -l option:
unzip -l example.zip
This command lists all files and directories inside the ZIP archive, along with their sizes and timestamps.
Method 2: Unzip Files Using the Graphical Interface (GUI)
If you’re using a desktop Linux environment, you can unzip files without touching the terminal.
Alternatively, choose “Extract to…” to select a custom directory for extraction.
This method is intuitive and keeps your files neatly organized by default.
Additional Tips for Working with ZIP Files in Linux
To test the integrity of a ZIP file without extracting it, use the -t option:
unzip -t example.zip
If your ZIP file is password-protected, use the -P option followed by the password:
unzip -P your_password example.zip
To suppress the output while extracting files, use the quiet mode option -q:
unzip -q example.zip -d extracted_files
Now you know multiple ways to unzip files in Linux, both from the terminal and through the graphical interface. Choose the method that best fits your workflow and keep your files organized!






