zip:打包和压缩文件
简介zip压缩格式是很多计算机平台通用的压缩格式。和gzip命令相比,zip命令压缩不仅不会删除源文件,而且还可以压缩目录
说明
zip压缩格式是很多计算机平台通用的压缩格式。和gzip命令相比,zip命令压缩不仅不会删除源文件,而且还可以压缩目录
格式
zip [option] [file]
常用参数
- -r:将指定目录下的所有文件和子目录一并压缩
- -x:压缩文件时排除某个文件
- -q:不显示压缩信息
示例
1、压缩文件
[root@localhost test]# cp /etc/services .
[root@localhost test]# ll -h services
-rw-r--r--. 1 root root 655K May 14 15:33 services
[root@localhost test]# zip services.zip ./services
adding: services (deflated 80%)
[root@localhost test]# ll -h services*
-rw-r--r--. 1 root root 655K May 14 15:33 services
-rw-r--r--. 1 root root 134K May 14 15:34 services.zip
2、压缩目录
[root@localhost ~]# zip test.zip ./test #不加-r参数将只会压缩目录这个额一个文件,所以这样使用不对
updating: test/ (stored 0%)
[root@localhost ~]# zip -r test.zip ./test #-r参数
adding: test/ (stored 0%)
adding: test/test_01.txt (stored 0%)
adding: test/test_02.txt (stored 0%)
adding: test/test_03.txt (stored 0%)
adding: test/test_04.txt (stored 0%)
adding: test/test_05.txt (stored 0%)
adding: test/test_06.txt (stored 0%)
adding: test/test_07.txt (stored 0%)
adding: test/test_08.txt (stored 0%)
adding: test/test_09.txt (stored 0%)
adding: test/test_10.txt (stored 0%)
adding: test/test_11.txt (stored 0%)
adding: test/test_12.txt (stored 0%)
adding: test/test.txt (stored 0%)
adding: test/services (deflated 80%)
adding: test/services.zip (stored 0%)
3、排除压缩文件
[root@localhost ~]# zip -r test.zip ./test -x test/services.zip test/services
updating: test/ (stored 0%)
updating: test/test_01.txt (stored 0%)
updating: test/test_02.txt (stored 0%)
updating: test/test_03.txt (stored 0%)
updating: test/test_04.txt (stored 0%)
updating: test/test_05.txt (stored 0%)
updating: test/test_06.txt (stored 0%)
updating: test/test_07.txt (stored 0%)
updating: test/test_08.txt (stored 0%)
updating: test/test_09.txt (stored 0%)
updating: test/test_10.txt (stored 0%)
updating: test/test_11.txt (stored 0%)
updating: test/test_12.txt (stored 0%)
updating: test/test.txt (stored 0%)
Towxml 是一个让小程序(微信/QQ)可以解析Markdown、HTML的解析库。能够使小程序完美解析Markdown内容。
网页扫描二维码库:Html5-Qrcode,官网地址:https://scanapp.org/html5-qrcode-docs/
最近想把公司的内网几台服务器能通过打开一个网站的方式进行管理,所以寻求了一圈最终选择了Teleport。Teleport,这是一个使用Go语言编写的,高效的现代SSH管理工具。
go-micro框架启用web服务(核心重点不是这里,只是要知道可以这样使用)
有时候为了打包需要敲很多命令,实在比较麻烦,所以这里记录了如何通过shell脚本将这些命令全部集中起来,后面可以直接执行该脚本就把需要的所有命令跑完。
快速生成表格
Electron页面跳转、浏览器打开链接和打开新窗口
在使用Git的过程中,不想每次都输入用户名和密码去拉取代码,所以就需要保存这些信息,那么既然有保存了,就必须有清除功能。
在Mac电脑中,如何对Git的用户名和密码进行修改呢?起初不懂Mac,所以整了很久,本文将记录如何对这个进行操作,以便后期使用。
Docker编译镜像出现:fetch http://dl-cdn.alpinelinux.org/alpine/v3.12/main/x86_64/APKINDEX.tar.gz
ERROR: http://dl-cdn.alpinelinux.org/alpine/v3.12/main: temporary error (try again later)
WARNING: Ignoring APKINDEX.2c4ac24e.tar.gz: No such file or directory问题