Skip to main content

How to unzip files on ubuntu

# Install unzip for handling .zip files

sudo apt-get update
sudo apt-get install -y unzip

# Command to unzip a .zip file

unzip filename.zip

# Install p7zip-full for handling .7z files

sudo apt-get update
sudo apt-get install -y p7zip-full

# Command to extract a .7z file

7z x filename.7z

# Install p7zip-rar for handling .rar files

sudo apt-get update
sudo apt-get install -y p7zip-rar

# Command to extract a .rar file using 7z

7z x filename.rar

# Install unrar for handling .rar files

sudo apt-get update
sudo apt-get install -y unrar

# Command to extract a .rar file using unrar

unrar x filename.rar

# Install gzip for handling .gz files

sudo apt-get update
sudo apt-get install -y gzip

# Command to extract a .gz file

gunzip filename.gz

# Install bzip2 for handling .bz2 files

sudo apt-get update
sudo apt-get install -y bzip2

# Command to extract a .bz2 file

bunzip2 filename.bz2

# Install xz-utils for handling .xz files

sudo apt-get update
sudo apt-get install -y xz-utils

# Command to extract a .xz file

unxz filename.xz

# Install lzma for handling .lzma files

sudo apt-get update
sudo apt-get install -y lzma

# Command to extract a .lzma file

unlzma filename.lzma

# Install tar for handling .tar files (useful for extracting .tar.gz and .tar.bz2 files)

sudo apt-get update
sudo apt-get install -y tar

# Command to extract a .tar file

tar -xvf filename.tar

# Command to extract a .tar.gz file

tar -xvzf filename.tar.gz

# Command to extract a .tar.bz2 file

tar -xvjf filename.tar.bz2

# Command to extract a .tar.xz file

tar -xvJf filename.tar.xz