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]# 
相关推荐
刃神太酷啦1 小时前
Linux 系统 MySQL 完整安装配置教程:从卸载 MariaDB 到优化 my.cnf----《Hello MySQL!》(1)
android·linux·c语言·c++·mysql·leetcode·mariadb
赵文宇(温玉)1 小时前
OpenEuler24.03 SP4 系统安装(欧拉/麒麟V10)
linux·openeuler·欧拉
2601_966799042 小时前
酷嗨米J300:一台相机同步推三平台
运维·服务器·负载均衡
AI行业说2 小时前
2026年清洁耗材智能模板机品牌排名:扫地机拖布、美妆粉扑工厂自动化选型指南
运维·自动化
派大鑫wink2 小时前
Dify 工作流搭建操作手册:以信息化运维周报自动生成为例
运维
志栋智能2 小时前
超自动化运维:支持微服务架构的运维模式
运维·架构·自动化
Bamtone20253 小时前
Bamtone班通:TDR阻抗测试仪如何高效助力AI服务器高速信号完整性验证?
服务器·人工智能·阻抗测试·阻抗分析
资深电气设计3 小时前
技术分析:空调机房水泵性能优势与系统适配性研究——水力能效、结构集成与智能运维维度
大数据·运维
Brilliantwxx3 小时前
【Linux】 进程(7)深度剖析 进程内核O(1)调度队列 + 饥饿问题
linux·运维·服务器
疯狂打码的少年3 小时前
【数据库技术】关系完整性约束(实体/参照/用户定义)
运维·服务器·数据库·笔记