Linux命令(69)之gunzip

linux命令之gunzip

1.gunzip介绍

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

2.gunzip用法

gunzip [参数] filename.gz

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

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]# 

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

小黑要上天

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值