Monday 3 November 2014

How to Split and Merge Files Easily in Ubuntu?


Sometimes you may wish to split a file, thereby making it easier to email or fit on storage devices. Here is a quick refresher course on splitting and joining.

Splitting

  • Open Application, "Terminal Program" on the Ubuntu menu bar, or using Main Menu -> Terminals -> Terminal Program.)
  • CD (change directory) to the directory where the file to be split is located. For instance,
  • cd /home/Songs/Mp3
  • To split a sample file (filename.mp3) into 2Mb parts with a suffix consisting of 2 numbers do:
  • split -a 2 -b 2m -d filename.mp3 parts
  • The option '-a 2' tells 'split' to use a suffix length of 2.
  • The option '-b 2m' tells 'split' to make parts of 2Mb size
  • The option '-d' tells 'split' to use numbers for the suffix instead of the default characters.
  • 'parts' is the first half of the name of the smaller files: parts00 parts01 parts02...
  • If the new smaller files don't show up immediately in Konqueror, hit F5 to force a screen refresh.

Joining

  • To join the smaller parts use the following:
  • cat parts* > filename.mp3
    The * (wildcard) tells 'cat' to use all files in the current directory that start with 'parts'.


Using GUI Compression Tools

Almost all the popular file compression tools archive managers have the ability to split files and then merge them later, which is also the case with Ubuntu. Thanks to the default archive manager (called File-Roller), you can split any file by using it as long as you're using a compression format that supports file splitting (.rar for instance).


But the problem of using A compression container format to split files and store them has a bit of a known risk. I think most would agree that (at least in my experience) some of these split files have a tendency to be corrupted, which is a common "headache" concerning file downloading. For instance, have you ever encountered a "CRC error" while trying to re-merge a file that was split and stored in the .rar compression format?? (errrrrrrrrrr :D).

So, to avoid or minimize these sort of difficulties we need to have a dedicated, specially designed file splitter. Although under MS Windows there a lot of free tools (HJSplit is pretty famous) available so is with GNU/Linux too!.



If you'd like to play with your command-line a little bit then there are few dozens available but if you want something with a GUI "attached" to it :)... that can be used under Ubuntu Linux, then Gnome Split is a utility worth trying.  It's written in Java and uses the GTK + toolkit thus integrates really well with Unity as well.

Main features...

*. Split and Merge any file.

*. 2 Times faster than the previous version according its the developers.

*. Even includes a "Wizard" for both splitting or merging.



*. Change file split using size or raw values, location, etc.

*. Use generic algorithms or different methods.

*. MD5 integrity checking.

*. Shows progress with speed, etc.



*. E-mail files afterward.

*. Enable/Disable notifications & few more settings can be accessed via the "Preferences" window.


You can install Gnome Split in Ubuntu easily by using its PPA channel. To do that, as usual, open your terminal window and enter the below commands.
sudo add-apt-repository ppa:gnome-split-team/ppa

sudo apt-get update

sudo apt-get install gnome-split  
So, if you want to avoid most of those merging errors + looking for a extremely easy to use, features rich, fast file splitter/jointer (PDF, .PST, multimedia files or anything!) that can be used in Ubuntu (or GNU/Linux in general), then Gnome Split is certainly one of the best out there without a doubt!.

No comments:

Post a Comment