How to extract a tar file inside a tar file

冷暖自知 提交于 2019-12-24 12:19:58

问题


I need help to extract a tar file inside a tar. I can extract the parent tar and then untar the child tar but trying to see if there any way to just extract the child tar without untaring parent tar..

eg:

tar -tf parent.tar

parent/
parent/child.tar
parent/file1
parent/file2
parent/file3

回答1:


You should add an argument to match the file inside the tar and use -O or --to-stdout to extract data to stdout to pipe and use another tar to extract it:

tar -xOf parent.tar parent/child.tar | tar -x


来源:https://stackoverflow.com/questions/18897060/how-to-extract-a-tar-file-inside-a-tar-file

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!