How to view the contents of the TAR Compression pack under Linux __linux

Source: Internet
Author: User
1. Use grep:
tar tvf package_name.tar | grep key_work
For example:
root@root ~]# tar tvf 
bb.tar-rw-r--r--       2011-10-20 17:27:00 aa
-rw-------root/root      1303
2011-10-13 19:10:07 anaconda-ks.cfg 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, directly specify a filename or wildcard
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
- rw-r--r--root/root      4404 2011-10-13 19:08:45 install.log.syslog

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.