Smart Systems for Home

Plain how-to guides for smart home, security and home Wi-Fi

How to Unzip File in Linux Ubuntu

· 5 min read · Home Tech

In this article
  1. What You'll Need
  2. Step-by-Step
  3. Common Mistakes
  4. Tips
  5. Troubleshooting
  6. Frequently Asked Questions

This guide shows you how to extract (unzip) compressed .zip files on Ubuntu Linux using both the graphical file manager and the command line. You’ll learn the essential commands, how to handle password-protected archives, and what to do when things don’t go as expected. No prior experience is needed—just follow the steps in order.

What You'll Need

  • An Ubuntu system (any recent version, e.g., 20.04, 22.04, 24.04).
  • A .zip file you want to extract.
  • Terminal access (for the command-line method).
  • If the zip is password-protected, you’ll need the password.

Step-by-Step

Method 1: Using the File Manager (GUI)

  1. Open the Files application (the default file manager in Ubuntu). You can find it in the dock or by pressing the Super key (Windows key) and typing “Files”.
  2. Navigate to the folder that contains your .zip file.
  3. Right-click on the .zip file. A context menu appears.
  4. Select Extract Here to unpack the contents directly into the current folder. Alternatively, choose Extract to… to pick a different destination folder.
  5. If you chose “Extract to…”, a dialog opens. Select the destination folder and click Select or Extract.
  6. Wait for the extraction to finish. A new folder (usually with the same name as the zip file) will appear containing the extracted files.

Method 2: Using the Command Line (Terminal)

  1. Open a terminal window. Press Ctrl+Alt+T or search for “Terminal” in the applications menu.
  2. Navigate to the directory that contains your .zip file. For example, if the file is in your Downloads folder, type: cd ~/Downloads and press Enter.
  3. To see the contents of the zip without extracting, use: unzip -l yourfile.zip (replace yourfile.zip with the actual filename).
  4. To extract the zip into the current directory, type: unzip yourfile.zip and press Enter.
  5. To extract into a specific folder, use the -d option: unzip yourfile.zip -d /path/to/destination. For example, unzip mydata.zip -d ~/Documents.
  6. If the zip is password-protected, add the -P option followed by the password (no space): unzip -P yourpassword yourfile.zip. Note: this exposes the password in the terminal history—use with caution.
  7. After extraction, verify the files are present with ls or by opening the destination folder.

Common Mistakes

  • Forgetting to install unzip: Some minimal Ubuntu installations don’t include the unzip utility. If you get “command not found”, install it with sudo apt install unzip.
  • Using the wrong case: Linux filenames are case-sensitive. unzip MyFile.zip is different from unzip myfile.zip. Make sure you type the exact filename.
  • Extracting over existing files: By default, unzip will overwrite files without asking. To avoid losing data, use the -n option to skip existing files or -o to overwrite only if the archive is newer.
  • Not using quotes for paths with spaces: If your filename or path contains spaces, enclose it in quotes: unzip "my file.zip".
  • Assuming the GUI extracts to a subfolder: “Extract Here” places files directly in the current folder, which might clutter it. Use “Extract to…” if you prefer a separate folder.

Tips

  • To extract multiple zip files at once, use a wildcard: unzip '*.zip' (quotes prevent shell expansion issues).
  • To see a progress bar during extraction, use the -v option (verbose) or install pv and pipe: unzip -p bigfile.zip | pv > /dev/null (this only tests integrity, not extraction).
  • To extract only specific files from an archive, list them after the zip name: unzip archive.zip file1.txt folder/file2.jpg.
  • Use unzip -Z (or zipinfo) to get detailed information about the archive, including compression method and file permissions.
  • For very large archives, consider using 7z (install with sudo apt install p7zip-full) which often handles them faster and supports more formats.

Troubleshooting

  • “unzip: command not found” – Install unzip: sudo apt update && sudo apt install unzip.
  • “End-of-central-directory signature not found” – This usually means the file is not a valid zip or is corrupted. Try re-downloading the file. If it came from a Windows system, ensure it was fully transferred (check file size).
  • “unsupported compression method” – The zip was created with a newer compression algorithm (e.g., Deflate64) that the standard unzip doesn’t support. Install p7zip-full and use 7z x file.zip instead.
  • Permission denied when extracting – You may not have write permission to the destination folder. Use sudo only if you trust the archive, or extract to a folder you own (e.g., your home directory).
  • Password prompt not appearing – If you use the -P option incorrectly (e.g., with a space), the password may be ignored. Use unzip -P 'yourpassword' file.zip (no space after -P).
  • Files extracted but empty or corrupted – Check if the archive itself is corrupted using unzip -t file.zip (test). If it fails, re-download.

Frequently Asked Questions

How do I unzip a file without installing anything?

Ubuntu’s default file manager (Nautilus) can extract zip files without any extra software. Right-click the file and choose “Extract Here”. If you need the command line, unzip is usually pre-installed; if not, you’ll need to install it.

What if the zip file is corrupted?

Try re-downloading the file. If it still fails, use unzip -t file.zip to test its integrity. For severely corrupted archives, tools like zip -FF or 7z can sometimes recover partial data.

How do I unzip a file with a password?

In the GUI, you’ll be prompted for the password. In the terminal, use unzip -P 'password' file.zip. Be aware that the password will be visible in your shell history—consider using unzip file.zip and typing the password when prompted instead.

Can I unzip a file to a different directory?

Yes. In the GUI, use “Extract to…” and select the folder. In the terminal, use the -d option: unzip file.zip -d /target/directory.

How do I unzip multiple files at once?

In the GUI, select all the zip files, right-click, and choose “Extract”. In the terminal, run unzip '*.zip' (quotes are important). This will extract each archive into the current directory.

What’s the difference between unzip and 7z?

unzip is the standard tool for .zip files and is pre-installed. 7z (from p7zip) supports many more formats (7z, rar, tar, etc.) and often handles large archives faster. For .zip files, unzip works fine; for other formats, use 7z.