How to unzip files in Linux using command line

by Pete
Published: Updated: 2 minutes read

If you’re new to Linux, you might be wondering how to unzip files in this operating system. Fortunately, unzipping files in Linux is easy and can be done through the command line or a graphical user interface. In this beginner’s guide, we’ll walk you through the different ways to unzip files in Linux.

Let’s get into it

  1. Open the terminal pressing Ctrl + Alt + T, and navigate to the directory where the zip file is located using the cd command. For example:
cd /path/to/zipfile
  1. Once you are in the correct directory, use the unzip command followed by the name of the zip file to unzip it. For example:
unzip example.zip
  1. If the zip file is password protected, use the -P option followed by the password to unzip it. For example:
unzip -P password example.zip
  1. By default, the contents of the zip file will be extracted into a new directory with the same name as the zip file. If you want to extract the contents into a specific directory, use the -d option followed by the directory path. For example:
unzip example.zip -d /path/to/extracted/folder
  1. You can also list the contents of a zip file without extracting it by using the -l option. For example:
unzip -l example.zip

In Summary

That’s it! You should now know how to unzip files in Linux using the command line.