如何从stdin中提取tar存档? [英] How to extract tar archive from stdin?

查看:95
本文介绍了如何从stdin中提取tar存档?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个很大的tar文件,我为split.是否可以使用管道cat并解压缩文件.

I have a large tar file I split. Is it possible to cat and untar the file using pipeline.

类似的东西:

cat largefile.tgz.aa largefile.tgz.ab | tar -xz

代替:

cat largefile.tgz.aa largfile.tgz.ab > largefile.tgz
tar -xzf largefile.tgz

我一直在环顾四周,找不到答案.我想看看是否有可能.

I have been looking around and I can't find the answer. I wanted to see if it was possible.

推荐答案

使用-作为输入文件:

cat largefile.tgz.aa largefile.tgz.ab | tar zxf -

请确保按分割它们的顺序排列它们.

Make sure you cat them in the same order they were split.

如果您使用的是zsh,则可以使用multios功能并避免调用cat:

If you're using zsh you can use the multios feature and avoid invoking cat:

< largefile.tgz.aa < largefile.tgz.ab tar zxf -

或者按字母顺序排列:

<largefile.tgz.* | tar zxf -

这篇关于如何从stdin中提取tar存档?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆