linux tar查看内容,linux下如何查看tar压缩包里面的内容

您所在的位置:网站首页 如何查看targz包里层的内容 linux tar查看内容,linux下如何查看tar压缩包里面的内容

linux tar查看内容,linux下如何查看tar压缩包里面的内容

#linux tar查看内容,linux下如何查看tar压缩包里面的内容| 来源: 网络整理| 查看: 265

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.cfg

drwxr-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.syslog

2、直接指定文件名或通配符

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



【本文地址】


今日新闻


推荐新闻


CopyRight 2018-2019 办公设备维修网 版权所有 豫ICP备15022753号-3