云服务器怎么压缩文件?我们经常会在云服务器系统上使用压缩命令,比如“.zip”格式压缩文件。zip 命令,类似于 Windows 系统中的 winzip 压缩程序,其基本格式如下:
[root@localhost ~]#zip [选项] 压缩包名 源文件或源目录列表
注意,zip 压缩命令需要手工指定压缩之后的压缩包名,注意写清楚扩展名,以便解压缩时使用。
zip 命令的基本使用
[root@localhost ~]# zip ana.zip anaconda-ks.cfg adding: anaconda-ks.cfg (deflated 37%) #压缩 [root@localhost ~]# ll ana.zip -rw-r--r-- 1 root root 935 6月 1716:00 ana.zip #压缩文件生成
不仅如此,所有的压缩命令都可以同时压缩多个文件,例如:
[root@localhost ~]# zip test.zip install.log install.log.syslog adding: install.log (deflated 72%) adding: install.log.syslog (deflated 85%) #同时压缩多个文件到test.zip压缩包中 [root@localhost ~]#ll test.zip -rw-r--r-- 1 root root 8368 6月 1716:03 test.zip #压缩文件生成
Copyright © 2013-2021 8a.hk All Rights Reserved. 八艾云 版权所有 中山市八艾云计算有限公司 粤ICP备14095776号