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]# 
相关推荐
apocelipes1 小时前
Linux c 运行时获取动态库所在路径
linux·c语言·linux编程
ABB自动化2 小时前
for AC500 PLCs 3ADR025003M9903的安全说明
服务器·安全·机器人
努力学习的小廉2 小时前
深入了解linux系统—— 进程池
linux·运维·服务器
秃头菜狗2 小时前
各个主要目录的功能 / Linux 常见指令
linux·运维·服务器
利刃大大2 小时前
【在线五子棋对战】二、websocket && 服务器搭建
服务器·c++·websocket·网络协议·项目
2301_793102493 小时前
Linux——MySql数据库
linux·数据库
vfvfb3 小时前
bat批量去掉本文件夹中的文件扩展名
服务器·windows·批处理·删除扩展名·bat技巧
jiunian_cn4 小时前
【Linux】centos软件安装
linux·运维·centos
藥瓿亭4 小时前
K8S认证|CKS题库+答案| 6. 创建 Secret
运维·ubuntu·docker·云原生·容器·kubernetes·cks
程序员JerrySUN4 小时前
[特殊字符] 深入理解 Linux 内核进程管理:架构、核心函数与调度机制
java·linux·架构