-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
【备忘清单】 请求: zip #319
Labels
Comments
@xtufw 要添加什么命令 zip/unzip 俩命令? |
重新提交了, 添加 linux zip 命令 |
@xtufw 已经添加,欢迎 PR 补充 |
jaywcjlove
added a commit
that referenced
this issue
Mar 8, 2023
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
🚧🚧🚧🚧🚧🚧🚧🚧🚧🚧🚧🚧🚧🚧🚧🚧🚧🚧
注意:请求太多,参考【优先级】快速添加内容
🚧🚧🚧🚧🚧🚧🚧🚧🚧🚧🚧🚧🚧🚧🚧🚧🚧🚧
优先级
说明项目
zip 命令使用技巧
【请您在这里介绍一下工具或者语言,这很重要】
linux 命令
zip 备忘清单
这是 zip 常用命令的快速参考备忘单。
入门
介绍
在Linux平台上,
zip
命令用于压缩文件。zip
是个使用广泛的压缩程序,压缩后的文件后缀名为 .zip。语法
选项
-A
-b
<工作目录>-c
-d
-D
-f
-F
-g
-h
-i
-j
-J
-k
-l
-ll
-L
-m
-n
-o
-q
-r
-S
-t
-T
-u
-v
-V
-w
-x
-X
-y
-z
-$
-<压缩效率>
创建一个 zip 格式的压缩文件
在当前工作目录的
/home/cyberpunk/testdir
目录下创建一个名为archive.zip
的zip
压缩文件:将 /home/cyberpunk/testdir 这个目录下所有文件和文件夹打包为当前目录下的 archive. zip -q -r archive.zip /home/cyberpunk/testdir 如果在我们在 /home/cyberpunk/testdir 目录下,可以执行以下命令: zip -q -r archive.zip * 从压缩文件 archive.zip 中删除文件 a.c zip -dv archive.zip a.c
本例中使用的选项有:
:- | -
:- | -
-r
| 递归处理,将指定目录下的所有文件和子目录一并处理。-q
| 不显示指令执行过程。-v
| 显示指令执行过程或显示版本信息。-d
| 从压缩文件内删除指定的文件。创建压缩后的
tar.gz
存档文件要创建一个压缩的
gzip
归档文件,我们需要使用选项z
。本例中使用的选项有:
:- | -
:- | -
-c
| 建立新的备份文件-v
| 显示指令执行过程-f
| 指定归档文件的文件名-z
| 通过gzip
指令处理备份文件压缩效率测下及选择
选项 -0 store only, -9 compress better, 默认是使用-6进行压缩, 以一个17G的目录testdir为例:
zip -6(default) 耗时
8m46
,压缩后包大小4.4G
, 解压此包耗时2m6.249s
。zip -9 耗时
20m16.389s
,压缩后包大小4.3G
, 解压此包耗时1m56.446s
。zip -1 耗时
4m23.021s
,压缩后包大小4.6G
, 解压此包耗时1m55.138s
。zip -0 耗时
1m9.021s
,压缩后包大小17G
, 解压此包耗时1m44.762s
。结论:使用
-1
时压缩效率和时间是比较好的选择。提供参考资料地址
提供更多参考资料有助于我们整理成备忘清单(速查表)
The text was updated successfully, but these errors were encountered: