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

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

下次还敢
Release: 2024-04-11 20:15:18
Original
643 people have browsed it

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>
Copy after login

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>
Copy after login

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

<code>unzip test.zip -d extract</code>
Copy after login

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

<code>unzip -l test.zip</code>
Copy after login

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

<code>unzip -x test.zip</code>
Copy after login

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!

Related labels:
source:php.cn
Statement of this Website
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
Latest Articles by Author
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template