hjsplit and linux split
The other day I had to fit in a 4.4 GB file (A Debian testing dvd iso image, if you want to know) on a 4 GB thumb drive. This, of course, is not possible. So I had to split the file into chunks, transfer them twice, take them to my friend’s windows machine and use hjsplit to join the files. How did I split the file so hjsplit could read it, when I didn’t use the linux version of hjsplit?
It looks like hjsplit splits its files by just cutting them into pieces. This is exactly what is done by the split command. Which is probably why I could use the linux split to split the file into a format hjsplit could join.
You could use a command similar to this one if you want to try it out :
$ split -b900M -d /home/anirudh/downloads/debian/debian-testing-i386-DVD-1.iso debian-testing-i386-DVD-1.iso.
the ‘-b’ option is used to specify the size of each chunk – 900 MB in this case. ‘-d’ means the output should be numeric (000,001,002…). Now we specify the large file and a prefix to attach to the generated filenames (note the dot at the end). This command will generate files :
debian-testing-i386-DVD-1.iso.000
debian-testing-i386-DVD-1.iso.001
debian-testing-i386-DVD-1.iso.002
debian-testing-i386-DVD-1.iso.003
debian-testing-i386-DVD-1.iso.004
Now this should be relatively easy to join with hjsplit. Do some renaming if required.
Edit :
meaculpa has noted that split starts renaming its files with 000 and not 001 as required by hjsplit. Please check his comment below for the solution.
As a follow up to this post, I had written another on how to join the split files in linux. You can check it out as well.
Related posts:


[...] is sort of a follow-up to my previous post which talked about how you can use the split command in Linux to create split files which can be joined with hjsplit on…. My theory is that hjsplit does the same thing split does – which is just take the file and [...]
hi,
i came accross your site because i was searching for a method to join linux-splitted files on windows…
the output files won’t be joinable with hjsplit, because hjsplit
expects an *.001 as first file. It can’t be set to *.000 .
the linux split command however will always start with *.000 and can’t be set to start at *.001 .
so there is no way around renaming each file in windows if you want to use hjsplit
for windows there are a lot of tools that can do the rename job for you. i found a tool called “Easy Rename” via google.
it has a built in function for renaming a bunch of files to *.001,*.002 and so on
but you don’t need these tools. you can also join the files without renaming them, by using the windows command prompt:
1. Open the command prompt
2. browse to your dir that includes the part files
3. type without the “: “copy /b debian-testing-i386-DVD-1.iso.* debian-testing-i386-DVD-1.iso”
this will join the files on windows even if they start with *.000
and you also don’t need a linux version of hjsplit
, the similar join command for linux would be:
1. browse to your dir that includes the part files
2. type without “: “cat debian-testing-i386-DVD-1.iso.* > debian-testing-i386-DVD-1.iso”
regards, meaculpa
Hello meaculpa,
All comments are moderated, sorry it took a while for me to approve your comment. Was a little busy.
What you say about having to rename files is absolutely true. Thanks for the heads up. I should have checked a little more closely before posting