User Tools

Site Tools


unix_commands:unzip

The unzip command in Linux and Unix-like systems is used to extract the files from a zip archive. The unzip command is the counterpart of the zip command.

Here are a few examples of how the unzip command can be used:

  1. Extract all files from a zip archive: unzip archive.zip
  2. Extract all files to a specific directory: unzip archive.zip -d /path/to/directory
  3. Extract only specific files: unzip archive.zip file1.txt file2.txt
  4. Extract files and directories with a specific extension: unzip archive.zip -x '*.txt'
  5. Extract and overwrite files without prompt: unzip -o archive.zip
  6. Extract and display archive contents: unzip -l archive.zip
  1. The -d option can be used to extract the files to a specific directory.
  2. The -x option can be used to exclude files with a specific pattern or extension.
  3. The -o option can be used to overwrite files without prompting for confirmation.
  4. The -l option can be used to display the contents of the archive without extracting the files.

In case of password protected archive, you will be prompted to enter the password before extracting the files.

It's also possible to use unzip -v archive_name.zip to list the detailed information about the archive and unzip -t archive_name.zip to test the archive for integrity, if there's any error in the archive it will be displayed.

unix_commands/unzip.txt ยท Last modified: 2023/01/17 08:42 by admin

CIFNet is a leading hosting solution provider, offering a wide range of services including IP bandwidth, co-location, VMware and KVM hosting.
Host Your Site with CIFNet!