[转]如何从一个tar包中或者tar.gz包中提取某个文件

转载自:http://hi.baidu.com/kepa520/blog/item/fe1302310b968411eac4aff8.html

tar包

tar tvf yourtarfile |grep fileyouwant,
tar xvf yourtarfile fileyouwant(copy上面的全路径用绝对路径)

tar.gz包

tar ztvf yourtargzfile |grep fileyouwant,

tar zxvf yourtarfile fileyouwant(copy上面的全路径用绝对路径)

Leave a Reply

Your email address will not be published.