Working with compressed files is a common task for any Linux user. Whether you are downloading software packages, transferring large projects, or archiving data, knowing how to unzip and extract files in Linux is an important skill. Linux provides several tools that make it simple to manage ZIP, TAR, GZ, and other archive formats efficiently. This guide explains different methods to unzip files in Linux using both command-line and graphical tools.
Compressed files help reduce file size and group multiple items into one archive for easier storage and transfer. Some of the most common archive formats in Linux are:
Knowing the file type helps you select the right command for extraction.
The terminal is the fastest and most efficient way to extract files in Linux. Below are some commonly used commands.
The unzip command is simple and available on most Linux distributions.
To extract a ZIP file, run:
unzip filename.zipIf the unzip tool is not installed, you can install it using:
sudo apt install unzip # For Debian or Ubuntu
sudo yum install unzip # For CentOS or RHELTo extract the contents into a specific directory:
unzip filename.zip -d /path/to/directoryTo view the contents of a ZIP file before extracting:
unzip -l filename.zipTAR files are commonly used for Linux packages and backups.
To extract a .tar file:
tar -xvf filename.tarFor a .tar.gz or .tgz file:
tar -xzvf filename.tar.gzExplanation of options:
To extract to a specific location:
tar -xzvf filename.tar.gz -C /destination/folderRAR and 7Z formats need extra tools. Install them with:
sudo apt install unrar p7zip-fullThen use these commands:
unrar x filename.rar
7z x filename.7zIf you prefer not to use the terminal, Linux desktop environments such as GNOME and KDE offer easy graphical tools.
Simply right-click on the compressed file and choose “Extract Here” or “Extract to…”.
Some popular graphical tools are:
These tools allow you to extract, preview, and create archives using simple drag-and-drop actions.
Learning how to unzip and extract files in Linux is an essential part of everyday file management. Whether you prefer the command line or graphical tools, Linux provides powerful and flexible methods for handling archives. By mastering commands such as unzip, tar, and 7z, you can manage compressed files easily and keep your system organized.
The groupdel command in Linux removes a group from the system. It deletes the group's entry from /etc/group and /etc/gshadow,…
The wc command in Linux counts lines, words, characters, and bytes in files or standard input. It…
The top command in Linux provides a real-time view of running processes and system resource usage. From…
The usermod command in Linux modifies existing user account attributes. You can use it to manage group…
The sort command in Linux reads lines from files or standard input and writes them to standard…
The wall command in Linux sends a message to the terminals of all currently logged-in users. The…