Linux中查看压缩包的内容,linux中肿么查看压缩包中的内容

在Linux环境中,可以使用`tar`命令查看tar压缩包内的文件信息。方法包括:1) 使用`tar tvf`结合`grep`查找特定内容;2) 直接通过`tar tvf`指定文件名或通配符来浏览压缩包内的特定文件。例如,通过`tar tvf bb.tar | grep log`可以查找包含log的文件。

linux下查看tar压缩包里面的内容,方法如下:

1、使用grep命令:

tar tvf Package_name.tar | grep Key_work#例如:[root@root ~]#tar tvf bb.tar -rw-r--r-- root/root 200 2011-10-20 17:27:00 aa-rw------- root/root 1303 2011-10-13 19:10:07 anaconda-ks.cfgdrwxr-xr-x root/root 0 2011-10-13 19:38:54 Desktop/-rw-r--r-- root/root 37640 2011-10-13 19:09:59 install.log-rw-r--r-- root/root 4404 2011-10-13 19:08:45 install.log.syslog[root@rhel55-37 ~]# tar tvf bb.tar |grep log-rw-r--r-- root/root 37640 2011-10-13 19:09:59 install.log-rw-r--r-- root/root 4404 2011-10-13 19:08:45 install.log.syslog2、直接指定文件名或通配符

tar tvf Package_name.tar [filename;*keyword*][root@root ~]# tar tvf bb.tar install.log-rw-r--r-- root/root 37640 2011-10-13 19:09:59 install.log [root@rhel55-37 ~]# tar tvf bb.tar *log*-rw-r--r-- root/root 37640 2011-10-13 19:09:59 install.log-rw-r--r-- root/root 4404 2011-10-13 19:08:45 install.log.syslog

取消

评论

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值