Linux命令(69)之gunzip

linux命令之gunzip

1.gunzip介绍

linux命令gunzip使用来解压缩使用gzip命令压缩的且后缀为".gz"的文件。我们知道gunzip是gzip的硬链接,因此执行gunzip是通过gzip命令来完成的

2.gunzip用法

gunzip [参数] filename.gz

|----|----------------------|
| 参数 | 说明 |
| -d | 解压缩文件 |
| -f | 强制解压缩,即使已存在同名的解压缩文件 |
| -l | 显示压缩文件的详细信息 |
| -r | 递归的解压缩指定目录下的所有文件 |
| -t | 测试压缩文件的正确性,不进行实际的解压缩 |
| -v | 显示解压缩的详细信息 |
[gunzip常用参数]

3.实例

3.1.解压缩zzz.txt.gz文件

命令:

gunzip zzz.txt.gz

[root@rhel77 ~]# gunzip zzz.txt.gz
[root@rhel77 ~]# ls -l zzz.txt 
-rw-r--r-- 1 root root 13 Jul 21 13:59 zzz.txt
[root@rhel77 ~]# 

3.2.显示zzz.txt.gz的详细信息

命令:

gunzip -l zzz.txt.gz

[root@rhel77 ~]# gunzip -l zzz.txt.gz 
         compressed        uncompressed  ratio uncompressed_name
                 32                  13  53.8% zzz.txt
[root@rhel77 ~]# gunzip -t zzz.txt.gz 
[root@rhel77 ~]# gunzip -v zzz.txt.gz 
zzz.txt.gz:	 53.8% -- replaced with zzz.txt
[root@rhel77 ~]# 

3.3.递归解压缩ztj目录下的文件

命令:

gunzip -rv ztj/

[root@rhel77 ~]# gunzip -rv ztj/
ztj//root.sh.gz:	 22.0% -- replaced with ztj//root.sh
ztj//root-1.sh.gz:	 22.9% -- replaced with ztj//root-1.sh
ztj//1.txt.gz:	  0.0% -- replaced with ztj//1.txt
ztj//2.txt.gz:	  0.0% -- replaced with ztj//2.txt
ztj//3.txt.gz:	  0.0% -- replaced with ztj//3.txt
ztj//4.txt.gz:	  0.0% -- replaced with ztj//4.txt
ztj//5.txt.gz:	  0.0% -- replaced with ztj//5.txt
ztj//6.txt.gz:	  0.0% -- replaced with ztj//6.txt
[root@rhel77 ~]# cd ztj
[root@rhel77 ztj]# ls
1.txt  2.txt  3.txt  4.txt  5.txt  6.txt  root-1.sh  root.sh  test
[root@rhel77 ztj]# 
相关推荐
anddddoooo2 小时前
域内证书维权
服务器·网络·网络协议·安全·网络安全·https·ssl
zhoupenghui1682 小时前
golang时间相关函数总结
服务器·前端·golang·time
lllsure2 小时前
Linux 实用指令
linux·物联网
努力的小T3 小时前
使用 Docker 部署 Apache Spark 集群教程
linux·运维·服务器·docker·容器·spark·云计算
Nerd Nirvana3 小时前
OpenSSL crt & key (生成一套用于TLS双向认证的证书密钥)
linux·ssl·shell·认证·加密·tls·oepnssl
不修×蝙蝠3 小时前
HTTP 协议(Ⅲ)
服务器·http·javaee·http协议
letisgo54 小时前
记录一次部署PC端网址全过程
linux·阿里云·服务器运维
梨落秋溪、4 小时前
输入框元素覆盖冲突
java·服务器·前端
枫叶落雨2224 小时前
08-Elasticsearch
运维·jenkins
猫猫的小茶馆4 小时前
【网络编程】UDP协议
linux·服务器·网络·网络协议·ubuntu·udp