jump to navigation

Split and Join tar.gz file on Linux December 30, 2010

Posted by Tournas Dimitrios in Linux.

One time, when we want to uploading a file, we are having difficulties because the file size is too large and our internet speed is so slow. Therefore, we must split our file into some small parts so we can upload it per small parts. How to do this?

First, we must compress the file with tarball archiver.

$ tar -cvvzf    [name-of-file].tar.gz     /path/to/folder

This command file archive our folder to *.tar.gz. We can use file instead of path to folder for the argument. Then we will split up our file archive into small parts.

$ split  -b  1M      [name-of-file].tar.gz     “parts-prefix”

-b 1M will split the file into 1 Megabytes size of file.The “part-prefix” will give the prefix name of our parts of file.


We have a video file name video.avi that have size of 30 MB. We will split it into 5 MB per parts. We can do :

$ tar  -cvvzf    test.tar.gz    video.avi
$ split -b 5M    test.tar.gz    vid

This command will create the archive file name test.tar.gz. Then, it will split into (approximately) six parts of 5MB file. They have prefix “vid”, so the result will be vidaa, vidab, vidac, vidad, vidae, and vidaf. We can use number instead of letter on the suffix by adding -d option on the split command

$ split  -b  5M  -d  test.tar.gz    video.avi

to join this file, we can use cat command.

$ cat  vid* >  test.tar.gz



1. Jay Jee - September 28, 2012


2. Jay Jee - September 28, 2012

I know it was written in 2010 but it is still helping ppl……so

Thanks for the efforts.

tournasdimitrios1 - September 28, 2012

@Jay Jee
You are welcome , thanks for your comments …

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s