Sunday, September 19, 2010

Linux Tip: Splitting and Merging multiple files

Ever so often, when you download large files from internet, you find the file being split into smaller parts. It's easier to upload this way and most file upload sites - rapidshare, hotfile etc. have a max file size limit.

There are many ways to merge these files. Let me show you two popular ways

a) Using cat to merge
cat file.1 file.2 file.3 > file

$ cat sitcom.avi.part1 sitcom.avi.part2 sitcom.avi.part3 > sitcom.avi


Using split to well, split
split [OPTION]... [INPUT [PREFIX]]
$ split -b 100M sitcom.avi sitcom.avi.

-b, stands for binary files

It's easy to write a shell script that takes in filename, chunk size, destination etc as parameters. But why not save the trouble and use the second alternative.

b) Using Gnome split

As the name suggests, you can merge, split files right from Gnome.

It also has some cool features like deleting the chunks after merge is completed etc.



Great. That was easy, wasn't it. I haven't found any KDE alternatives yet. Feel free to share them in the comments. Thanks.

No comments: