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]# 
相关推荐
likfishdn12 分钟前
Linux的文件与目录管理
linux·运维·服务器
渲染101专业云渲染14 分钟前
川翔云电脑优势总结
服务器·3d·电脑·blender·maya
chian-ocean32 分钟前
Linux 文件缓冲区:高效数据访问的幕后推手
linux·运维·服务器
加油=^_^=34 分钟前
【Linux】进程优先级 | 进程调度(三)
linux·运维·服务器
橘子味的茶二43 分钟前
高级系统架构师--第十章:计算机网络
服务器·计算机网络·系统架构
吃汤圆的抹香鲸1 小时前
GoLand 安装包 绿色版 Win,Mac,Linux 包含IntelliJ全家桶 专为Go语言设计的集成开发环境(IDE)
linux·windows·macos·go·intellij-idea·go1.19
紫菜(Nori)1 小时前
短连接服务器压测-wrk
服务器·压力测试
追寻光1 小时前
Cannot find a valid baseurl for repo: base/7/x86_64
linux
元气满满的热码式1 小时前
Docker数据卷操作实战
linux·运维·docker·云原生·容器
陆沙1 小时前
deepseek-r1-centos-本地服务器配置方法
linux·服务器·centos