Linux command
unzip 命令
网络
复制后可按需替换文件名、目录或参数。
常用示例
Extract files
unzip [archive.zip]
Extract to specific directory
unzip [archive.zip] -d [/path/to/directory]
List contents
unzip -l [archive.zip]
Extract specific files
unzip [archive.zip] [file1.txt] [file2.txt]
Extract with pattern
unzip [archive.zip] "*.txt"
Extract quietly
unzip -q [archive.zip]
Extract and overwrite
unzip -o [archive.zip]
Test archive integrity
unzip -t [archive.zip]
Extract preserving directory structure
unzip [archive.zip]
说明
unzip extracts files from ZIP archives. It handles archives created by zip, WinZip, PKZIP, and other ZIP-compatible programs. The tool supports various compression methods and can handle encrypted archives. By default, unzip extracts all files to the current directory, preserving the directory structure stored in the archive. Individual files or patterns can be specified for selective extraction. unzip is part of the InfoZip project and is the standard ZIP extraction tool on Unix-like systems.
参数
- -l
- List archive contents.
- -v
- Verbose listing with compression info.
- -t
- Test archive integrity.
- -d _dir_
- Extract to specified directory.
- -o
- Overwrite existing files without prompt.
- -n
- Never overwrite existing files.
- -q
- Quiet mode.
- Very quiet mode.
- -j
- Junk paths (don't make directories).
- -p
- Extract to stdout (pipe).
- -P _password_
- Use password for encrypted files.
- -x _files_
- Exclude specified files.
- -C
- Case-insensitive matching.
- -a
- Convert text file line endings.
FAQ
What is the unzip command used for?
unzip extracts files from ZIP archives. It handles archives created by zip, WinZip, PKZIP, and other ZIP-compatible programs. The tool supports various compression methods and can handle encrypted archives. By default, unzip extracts all files to the current directory, preserving the directory structure stored in the archive. Individual files or patterns can be specified for selective extraction. unzip is part of the InfoZip project and is the standard ZIP extraction tool on Unix-like systems.
How do I run a basic unzip example?
Run `unzip [archive.zip]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.
What does -l do in unzip?
List archive contents.