Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

How can I create a multipart tar file in Linux?

share|improve this question
    
1  
Similar, but not the same. The linked question @Sathya points to is more complex and requires a more complicated solution. –  Ian C. Oct 13 '10 at 19:46

2 Answers 2

up vote 19 down vote accepted

You can use the split command to split an archive in to multiple files. For example, if I wanted my archive stored in 1 MByte files:

tar -cvf - <stuff to put in archive> | split --bytes=1m --suffix-length=4 --numeric-suffix - myarchive.tar.

And when I want to recombine and untar:

cat myarchive.tar.* | tar xvf -
share|improve this answer
    
Awesome. Thanks. –  hopeseekr Oct 13 '10 at 16:52

Use tar c to create the tar archive, and specify the k size-in-kbytes parameter to control the maximum size of each part. You'll end up with ((original size)/(part size) + 1) parts.

share|improve this answer
    
Where did you get the "k size-in-kbytes parameter"? Can't seem to find it on Linux. –  sleske Oct 13 '10 at 0:30
    
saw it here: computerhope.com/unix/utar.htm –  Traveling Tech Guy Oct 13 '10 at 4:08
    
Not in Gentoo linux, unfortunately. –  hopeseekr Oct 13 '10 at 16:53

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.