小樱知识 > 生活常识 > 压缩文件包怎么打开(使用压缩包压缩文件的技巧)

压缩文件包怎么打开(使用压缩包压缩文件的技巧)

提问时间:2022-03-16 13:44:47来源:小樱知识网


我们经常会在 Windows 系统上使用 “.zip”格式压缩文件,其实“.zip”格式文件是 Windows 和 Linux 系统都通用的压缩文件类型,属于几种主流的压缩格式(zip、rar等)之一,是一种相当简单的分别压缩每个文件的存储格式。

本节要讲的 zip 命令,类似于 Windows 系统中的 winzip 压缩程序,其基本格式如下:

[root@localhost ~]

#zip [选项] 压缩包名 源文件或源目录列表

注意,zip 压缩命令需要手工指定压缩之后的压缩包名,注意写清楚扩展名,以便解压缩时使用。

该命令常用的几个选项及各自的含义如表 1 所示。

表 1 zip 命令常用选项及含义

下面给大家举几个例子。

【例 1】zip 命令的基本使用。

[root@localhost ~]# zip ana.zip anaconda-ks.cfgadding: 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.syslogadding: 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#压缩文件生成

【例 2】使用 zip 命令压缩目录,需要使用“-r”选项,例如:

[root@localhost ~]# mkdir dir1#建立测试目录

[root@localhost ~]

# zip -r dir1.zip dir1adding: dir1/(stored 0%)#压缩目录

[root@localhost ~]

# ls -dl dir1.zip-rw-r–r– 1 root root 160 6月 1716:22 dir1.zip#压缩文件生成

我是大仁笔记,欢迎一起学习交流。

以上内容就是为大家推荐的压缩文件包怎么打开(使用压缩包压缩文件的技巧)最佳回答,如果还想搜索其他问题,请收藏本网站或点击搜索更多问题

内容来源于网络仅供参考
二维码

扫一扫关注我们

版权声明:所有来源标注为小樱知识网www.cnfyy.com的内容版权均为本站所有,若您需要引用、转载,只需要注明来源及原文链接即可。

本文标题:压缩文件包怎么打开(使用压缩包压缩文件的技巧)

本文地址:https://www.cnfyy.com/shcs/119903.html

相关文章