Home  >  Article  >  System Tutorial  >  What is the command to decompress a zip file in Linux?

What is the command to decompress a zip file in Linux?

下次还敢
下次还敢Original
2024-04-11 20:15:18611browse

The common command for decompressing ZIP files in Linux is unzip. The usage is: unzip [option] zip_file_path [target directory]. Common options include: specify target directory (-d), show directory (-e), force overwrite of file (-f), list directory (-l), show only file name (-n), provide password (-P) , test file integrity (-t).

What is the command to decompress a zip file in Linux?

Linux decompression ZIP file command

In Linux systems, the most commonly used command to decompress ZIP files isunzip.

Usage:

<code>unzip [选项] zip_文件_路径 [目标目录]</code>

Options:

  • -d: Specify the decompressed Target directory. If not specified, it will be extracted in the current directory.
  • -e: Display the internal directory of the ZIP file before decompression.
  • -f: Force overwriting of an existing file with the same name.
  • -l: List the internal directories of the ZIP file without actually decompressing it.
  • -n: Only displays the decompressed file name without actually decompressing it.
  • -P Password: If the ZIP file is password protected, use this option to provide the password.
  • -t: Test whether the ZIP file is damaged.

Example:

Unzip the file named "test.zip" and extract it into the current directory:

<code>unzip test.zip</code>

Unzip file and extract it into the "extract" directory:

<code>unzip test.zip -d extract</code>

Show the internal directory of the ZIP file without actually extracting it:

<code>unzip -l test.zip</code>

Extract the file interactively and select the file you want to extract before extracting Extracted files:

<code>unzip -x test.zip</code>

The above is the detailed content of What is the command to decompress a zip file in Linux?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn