Linux命令(136)之zcat

linux命令之zcat

1.zcat介绍

linux命令在zcat是用来查看gz结尾的压缩文件。

2.zcat用法

zcat [参数] filename

zcat参数
参数说明
-c将文件内容写到标准输出
-l显示压缩包中文件的列表
-L显示软件许可信息
-t测试文件的完整性
-f强制覆盖输出文件和压缩链接

3.实例

3.1.将文件内容写到标准输出

命令:

zcat -c aa.txt.gz

[root@centos79 ~]# zcat -c aa.txt.gz 
aaaa
aaaa
aaaa
aaaa
aaaa
[root@centos79 ~]# 

3.2.显示压缩包中文件的列表

命令:

zcat -l aa.txt.gz

[root@centos79 ~]# zcat -l aa.txt.gz 
         compressed        uncompressed  ratio uncompressed_name
                 35                  25  60.0% aa.txt
[root@centos79 ~]# 

3.3.显示软件许可信息

命令:

zcat -L aa.txt.gz

[root@centos79 ~]# zcat -L aa.txt.gz 
gzip 1.5
Copyright (C) 2007, 2010, 2011 Free Software Foundation, Inc.
Copyright (C) 1993 Jean-loup Gailly.
This is free software.  You may redistribute copies of it under the terms of
the GNU General Public License <http://www.gnu.org/licenses/gpl.html>.
There is NO WARRANTY, to the extent permitted by law.
[root@centos79 ~]# 

3.4.测试文件的完整性

命令:

zcat -t aa.txt.gz

[root@centos79 ~]# zcat -t aa.txt.gz
[root@centos79 ~]# 

3.5.查看普通文件中的内容

命令:

zcat -f data.txt

[root@centos79 ~]# zcat -f data.txt
bbbb
[root@centos79 ~]# 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

打赏作者

小黑要上天

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

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

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

打赏作者

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

抵扣说明:

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

余额充值