linux下不解包查看tar包文件內容

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.syslogroot@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

linux下如何將一個新增文件加入到一個壓縮文件中

可以使用tar uf,例如:
tar uf test.tar aaa.txt可以使用tar -uf,例如:
tar uf test.tar aaa.txt

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章