Languages
[Edit]
EN

Linux - unpack zip file

15 points
Created by:
Remy-Lebe
802

In this short article, we would like to show how to unpack files from *.zip file using unzip under Linux.

Quick solution:

unzip file.zip

# or:

unzip /path/to/file.zip

Where:

  • file.zip or /path/to/file.zip should be replaced with a desired zip file path.

Note: by default files will be extracted to the current working directory - check the below usage variants to see how to change output directory path (-d parameter).

 

Usage variants

In this section, you will see the most common unzip usage cases.

1. Unpack files into the indicated directory

unzip file.zip -d ./output

# or

unzip /path/to/file.zip -d /path/to/output

Where:

  • -d ./output or -d /path/to/output indicate the location where files will be extracted.

2. Suppress unpacking messages

unzip -q file.zip

# or:

unzip -q /path/to/file.zip

Where:

  • -q disables printing messages related to unpacking in the console.

3. Use zip archive password

unzip -P "zip_file_password" file.zip

# or:

unzip -P "zip_file_password" /path/to/file.zip

Where:

  • -P "zip_file_password" indicates the password necessary to unpack the zip file.

4. Overwrite existing files without prompting

unzip -o file.zip

# or:

unzip -o /path/to/file.zip

Where:

  • -o forces already extracted files overwriting (if there exists extracted file before - it will be overwritten)

     

      unzip command installation

      To install under Debian/Ubuntu-based Linux it is necessary to use the following command:

      sudo apt-get install unzip

      Alternative titles

      1. Linux - extract zip file
      2. Linux - unzip file
      Donate to Dirask
      Our content is created by volunteers - like Wikipedia. If you think, the things we do are good, donate us. Thanks!
      Join to our subscribers to be up to date with content, news and offers.

      Linux

      Native Advertising
      🚀
      Get your tech brand or product in front of software developers.
      For more information Contact us
      Dirask - we help you to
      solve coding problems.
      Ask question.

      ❤️💻 🙂

      Join