糖尿病康复,内容丰富有趣,生活中的好帮手!
糖尿病康复 > linux的解压zip文件 Linux解压zip文件命令

linux的解压zip文件 Linux解压zip文件命令

时间:2021-06-25 07:51:37

相关推荐

linux的解压zip文件 Linux解压zip文件命令

Post Views:

98

1. 前言

通常情况下,Linux系统并不会产生zip文件,而是由用户把zip文件上传到Linux系统中,产生解压的需求。

2. 安装zip解压工具unzip

以CentOS7.5最小化安装为例,系统并没有集成unzip工具,需要额外安装

[root@zcwyou ~]# yum -y install unzip

看到以下输出即代表安装成功。

Running transaction

Installing : unzip-6.0-19.el7.x86_64 1/1

Verifying : unzip-6.0-19.el7.x86_64 1/1

Installed:

unzip.x86_64 0:6.0-19.el7

Complete!

先查看一下压缩文件 3. 解压文件

先查看一下压缩文件

[root@zcwyou zip]# ll *.zip

查询结果如下

total 4

-rw-r--r--. 1 root root 3032 Dec 4 17:14 zcwyou.zip

解压这个zcwyou.zip文件

[root@zcwyou zip]# unzip zcwyou.zip

执行过程如下:

Archive: test.zip

inflating: 333.txt

extracting: abc.txt

inflating: cisco1.txt

inflating: cisco2.txt

extracting: compress.txt

extracting: cp1.txt

extracting: cp2.txt

inflating: cut2.txt

extracting: cut.txt

extracting: diff1.txt

extracting: diff2.txt

creating: dir123/

extracting: hard123.txt

extracting: hard.txt

extracting: linux123.txt

extracting: soft.txt

extracting: test.txt

可以看到,unzip程序创建了一个目录dir123/,并且解压了一些文件。目录dir123是压缩文件里的一个目录。

检查:

[root@zcwyou zip]# ll

total 40

-rw-r--r--. 1 root root 315 Nov 27 16:15 333.txt

-rw-r--r--. 1 root root 9 Nov 21 11:39 abc.txt

-rw-r--r--. 1 root root 173 Oct 13 15:24 cisco1.txt

-rw-r--r--. 1 root root 179 Oct 13 15:24 cisco2.txt

-rw-r--r--. 1 root root 0 Oct 12 14:40 compress.txt

-rw-r--r--. 1 root root 0 Oct 11 10:23 cp1.txt

-rw-r--r--. 1 root root 0 Oct 11 10:23 cp2.txt

-rw-r--r--. 1 root root 57 Oct 12 13:45 cut2.txt

-rw-r--r--. 1 root root 50 Oct 12 11:59 cut.txt

-rw-r--r--. 1 root root 9 Oct 13 14:59 diff1.txt

-rw-r--r--. 1 root root 18 Oct 13 15:00 diff2.txt

drwxr-xr-x. 2 root root 6 Dec 4 17:06 dir123

-rw-r--r--. 1 root root 0 Nov 26 17:47 hard123.txt

-rw-r--r--. 1 root root 0 Nov 26 17:47 hard.txt

-rw-r--r--. 1 root root 0 Nov 29 17:25 linux123.txt

-rw-r--r--. 1 root root 0 Nov 26 17:47 soft.txt

-rw-r--r--. 1 root root 10 Nov 19 13:33 test.txt

-rw-r--r--. 1 root root 3032 Dec 4 17:14 zcwyou.zip

发现zcwyou.zip里的文件已经被全部解压出来了,并且保留了源文件zcwyou.zip。

解压其它例子

如果觉得《linux的解压zip文件 Linux解压zip文件命令》对你有帮助,请点赞、收藏,并留下你的观点哦!

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。