Files
tldr/pages.zh/common/7z.md

36 lines
971 B
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# 7z
> 一个具有高压缩比的文件归档工具。
> 更多信息:<https://manned.org/7z>。
- [a] 将文件或目录添加到新的或现有的归档中:
`7z a {{path/to/archive.7z}} {{path/to/file_or_directory}}`
- 对现有归档进行加密(包括文件名):
`7z a {{path/to/encrypted.7z}} -p{{password}} -mhe=on {{path/to/archive.7z}}`
- E[x] 提取归档,保留原始目录结构:
`7z x {{path/to/archive.7z}}`
- E[x] 将归档提取到特定目录:
`7z x {{path/to/archive.7z}} -o{{path/to/output}}`
- E[x] 将归档提取到 `stdout`
`7z x {{path/to/archive.7z}} -so`
- [a] 使用特定的归档类型进行归档:
`7z a -t{{7z|bzip2|gzip|lzip|tar|zip}} {{path/to/archive}} {{path/to/file_or_directory}}`
- [l] 列出归档的内容:
`7z l {{path/to/archive.7z}}`
- 设置压缩级别(级别越高,压缩越多,但速度越慢):
`7z a {{path/to/archive.7z}} -mx={{0|1|3|5|7|9}} {{path/to/file_or_directory}}`