Splitting Large Files in Linux

Splitting large files in Linux is easy and very handy. Lets say you have a large file such as a video, music or a very large backup file that you need to save to a DVD or Blu-Ray media. Here is a way to split the file to a size that will fit on your media of choice.

Don’t forget to change the location and name of file to match your info. Make sure you have the period and the end on (/data/Backup/file-to-split.img.) As  the operation splits the file, the period at the end of the file name becomes the number of splits you will have depending on the size of the file.

Lets say the file size is 32 gig and your backing up to a Blu-Ray writable disc at 25 gigs per disc, then you should end up with to files like this

EXP: file-to-split.img.000 and file-to-split.img.001 

You can change the file size to match the media your storing to.

Splitting Large Files and Re-Joining in Linux

Blu-ray Split File: **********

split -d -a 3 -b 23000m /data/Backup/file-to-split.img /data/Backup/file-to-split.img.

Restore Split File: **********

cat /data/Backup/file-to-split.img.* > /data/Backup/file-to-split.img

DVD Split File: **********

split -d -a 3 -b 3900m /data/Backup/file-to-split.img /data/Backup/file-to-split.img.

Restore Split File: **********

cat /data/Backup/file-to-split.img.* > /data/Backup/file-to-split.img

Leave a Comment

You must be logged in to post a comment.