Tag Archives: combine files

Splitting in Linux and Combining in Windows

i don’t know if you do this on a daily, monthly, yearly, or never basis, but i do some times.  what is it that i do?!

whenever i want to email or upload gigs of information over the net usually takes for ever.  the file might be upload it incorrectly or the file won’t go through because is too big.  well, there are applications out there that you can use in order to be able to split files.  for example, if you are compressing an application using WinRar, it will automatically create *.rar-xxx which it will have your files separated depending on the size that you specified.  well, i believe there is a easier way to be able to perform this.

OK, now lets say that you are using Linux and you would like to split a 1GB file into 100MB files.  the way to do this is using the split command… and it will go like this:

split --bytes=100mb file1 file_

where you will replace file1 with the actual name of the file (e.g. MyFamilyDVD.iso) and file_ will be how the files will be renamed (e.g. MyFamilyDVD.iso_)

now, lets say that you upload these files to a server and your friend download them.  your friend will need the following command in order to be able to combine the files:

cat file_* > file1

where file_* are all the files that were created (e.g. MyFamilyDVD.iso_*) and file1 is the actual name of the file to be created (e.g. MyFamilyDVD.iso).

so, lets say that your buddy doesn’t have Linux and they have Windows instead.  here is the command that they will need in order to combine all of those files.

copy /B file_1+file_2+file_3 file1

where file_1+file_2+file_3 (e.g. MyFamilyDVD.iso_*)will be all the files created and file1 will be the actual name of the file to be created. the bad thing in windows is that you won’t be able to use the asterisk and you will need to type file per file.

any ways i hope this helps!!!