- 1How to Create a File in Linux
- 2How to Rename a File in Linux
- 3How to Copy a File in Linux
- 4How to Move a File in Linux
- 5How to Delete a File in Linux
- 6How to Create a Directory in Linux
- 7How to Delete a Directory in Linux
- 8How to Copy Directories Recursively in Linux
- 9Delete Directories Recursively in Linux
- 10How to View Hidden Files in Linux
- 11How to Create a Hidden File in Linux
- 12How to Create a Hidden Directory in Linux
- 13How to Find Files in Linux Using find Command
- 14Find Files in Linux Using locate Command
- 15How to View File Contents Using cat in Linux
- 16How to View File Contents Using less in Linux
- 17View File Contents Using the more Command in Linux
- 18Compare Files Using diff Command in Linux
- 19Compare Files in Linux Using cmp Command
- 20Check File Type in Linux with file Command
- 21Create Symbolic Links with ln -s in Linux
- 22How to Archive Files Using tar Command in Linux
- 23Compress Files with gzip in Linux – Beginner Tutorial
- 24How to Compress Files Using bzip2 in Linux
- 25Compress Files in Linux Using zip Command
- 26Extract Compressed Files using tar in Linux
- 27Extract ZIP Files on Linux with unzip
- 28How to Extract .gz Files using gunzip in Linux
How to Extract Compressed Files Using unzip Command
How to Extract Compressed Files Using unzip
Command in Linux
Hey there! 👋 Welcome to this Linux tutorial on working with ZIP files.
If you're coming from Windows or macOS, you're probably used to just double-clicking ZIP files to extract them. But in Linux, we use a simple and powerful command-line tool called unzip
.
Let’s break this down step by step, just like we would if we were sitting side-by-side at your terminal.
🔧 Step 1: Make Sure unzip
is Installed
Most Linux distributions come with unzip
pre-installed. But if yours doesn't, you can install it easily using your package manager.
sudo apt install unzip # For Ubuntu/Debian
sudo yum install unzip # For CentOS/RHEL
sudo dnf install unzip # For Fedora
Once installed, you're good to go.
📁 Step 2: Extract a ZIP File
Now let’s say you have a ZIP file called project.zip
. To extract it, just run:
unzip project.zip
This will extract the contents of project.zip
into the current directory.
✅ Output:
Archive: project.zip
inflating: index.html
inflating: style.css
inflating: script.js
📂 Step 3: Extract to a Specific Directory
If you want to extract the ZIP file into a folder named project/
, you can do this:
unzip project.zip -d project/
This is especially useful for keeping things clean and organized.
🔍 Step 4: View the Contents Without Extracting
Want to peek inside the ZIP without extracting it? You can list the contents using:
unzip -l project.zip
✅ Output:
Archive: project.zip
Length Date Time Name
--------- ---------- ----- ----
1200 2025-07-02 09:00 index.html
9000 2025-07-02 09:00 style.css
3400 2025-07-02 09:00 script.js
--------- -------
13600 3 files
🧹 Step 5: Overwrite or Skip Existing Files
If some files already exist in the directory, unzip
will ask you whether to overwrite them. You can automate this with:
-o
: Overwrite files without asking-n
: Never overwrite existing files
unzip -o project.zip # Overwrite without prompt
unzip -n project.zip # Skip existing files
🎯 Final Tip
ZIP files are super common when sharing projects or downloading from the internet. Knowing how to use unzip
gives you an edge and helps you stay productive in any Linux environment.
That’s it! You've now learned how to extract ZIP files like a Linux pro 💪
See you in the next tutorial!
Next Topic ⮕How to Extract .gz Files using gunzip in Linux
Comments
Loading comments...