HOWTO split files using GNU split

From SHellium Wiki
Jump to: navigation, search
Geographylogo.png In other languages: English | Afrikaans | Albanian | Arabic | Brazilian | Bulgarian | Catalan | Chinese | Croatian | Czech | Danish | Dutch | Esperanto | Estonian | Filipino | Finnish | Flemish | French | German | Greek | Hebrew | Hindi | Hungarian | Indonesian | Italian | Japanese | Latvian | Lithuanian | Macedonian | Malay | Malayalam | Norwegian (Bokmål) | Norwegian (Nynorsk) | Persian | Polish | Portuguese | Romanian | Russian | Serbian | Slovak | Slovenian | Spanish | Swedish | Turkish | Ukrainian | Urdu

Well here is typical scenario you have two 1GB pen drive and 2GB file transport!!


What would you do?

Split is utility that comes with GNU coreutils its really useful at situations like above. It allow the user to split a large file into small manageable size of MB KB or what ever apt to the situation.

For survival sake we make use if only -b and parameters associated with it.

Well here it goes...

My file is of size 1.4 GB i need to split it to a chunk of 700MB

split -b 700m myfile myfile-split

Now you might be wondering what would be the name of second half ?

myfile-split is a typical name that i gave you can choose any name , myfile-split is the base output name when the chunks are made it would create myfile-splitaa,myfile-splitab etc ...

Once complete you can do any operation on your file like compressing it using bzip2 .

Now How do i join ?

On UNIX like system

$cat myfile-split* > myfile

On Windows

>copy /b myfile-split* myfile

SIZE may have a multiplier suffix: b 512, kB 1000, K 1024, MB 1000*1000, M 1024*1024, GB 1000*1000*1000, G 1024*1024*1024, and so on for T, P, E, Z, Y.

Personal tools

SHellium Sites