Phoenix Devs
Phoenix Devs

Reputation: 131

Untar multiple *.tar.gz.aa *.tar.gz.ab pattern files

I tarred a folder and split it into tar.gz files of 200mb when zipping. How can I go about unzipping them? Is there a way I can do this in one command or do I have to do each one separately?

Upvotes: 13

Views: 19978

Answers (2)

glglgl
glglgl

Reputation: 91159

You even cannot do it separately.

Just undo what you did in reversed order:

  • first concatenate them
  • then unzip them
  • then untar

So you do

cat *.tar.gz.* | zcat | tar xvf -

or, even shorter,

cat *.tar.gz.* | tar xvfz -

Upvotes: 19

You can use the bellow :

$ cat *.tar | tar -xvf - -i

cat command, listed .tar files, then listed files will extracted with tar -xvf - -i command.

Upvotes: 3

Related Questions