Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I searched before posting the question, but couldn't find anything related. All I need is some help in splitting a zip file in ubuntu as .z01, .z02 etc... so that I would join them in windows back.

EDIT: I realized that I don't have access to command prompt in windows. How would I unzip files now?

share|improve this question

2 Answers 2

up vote 6 down vote accepted

On Ubuntu you can use the split command to split your zip file. Something like this should work:

split your-zip.zip -b 32M ZIPCHUNKS

This will create a bunch of ZIPCHUNKS* files, in order, and all 32 MB or less in size. Change the 32M parameter to vary the chunk size.

Traditionally you'd use cat to glue them back together:

cat ZIPCHUNKS* > reassembled-zip.zip

Since you want to do the reassembling on Windows, you need a substitute for cat. I can't help much on that side, but you may find a few ways to do it here:

http://stackoverflow.com/questions/60244/is-there-replacement-for-cat-on-windows

You can also use rar which natively supports creating "split" archives which can then be decompressed by a GUI tool on Windows such as WinZip or WinRar. On Ubuntu, install the rar package, then:

rar a -v32M destination.rar files/to/compress

This will create files called destination.partXX.rar. Transfer these to Windows, then unrar the first one (destination.rar), which will link to the others automatically.

One trick you can potentially use is to "rar" the original zip file, that way you can reassemble it on Windows. If you have the original files, it may be easier to just rar them and work with that.

share|improve this answer
    
Thanks for the help on split command as well as the stackoverflow link. Really helpful. I'm wondering now that I don't even have access to command line. How do I unzip the splitted files now? –  kunaguvarun Dec 12 '12 at 16:30
    
Your command ZIPCHUNKS creates ZIPCHUNKSaa, etc.. They are of unknown file type. I wonder whether they'll be detected in windows –  kunaguvarun Dec 12 '12 at 16:42
    
The "chunks" are not stand-alone zip files, they need to be put back together in order for the zip file to be valid. I'll update my answer to show a way of doing this with rar, which can produce "chunked" archives (called "volumes) and be decompressed with WinZip (which I hope you have installed) or WinRAR. If not, you'd have to tell me which archive management tools are installed on your Windows system. –  roadmr Dec 12 '12 at 16:43
    
yes, the chunks themselves are unrecognizable, I wouldn't trust Windows to detect them as anything, that's why I mentioned you have to reassemble them somehow, then rename the resulting file to .zip. But the pieces themselves will be useless until reassembled. –  roadmr Dec 12 '12 at 16:47
    
Thanks roadmr. I used zip command with --out option and they're recognizable in windows –  kunaguvarun Dec 13 '12 at 3:34

I had to do this a year or more ago. It is inconvenient, because Windows just doesn't have the same tools.

I ended up using GSplit, which does work under WINE (or PlayOnLinux). It creates a .exe file and a bunch of .gsd files. If you are zipping a PDF file, you need to pre-zip it because Windows gets confused!

share|improve this answer
    
Thanks, but I don't have permissions to install any tools where I need to join the files –  kunaguvarun Dec 12 '12 at 16:30
    
In that case, you'll have to use the solution that roadmr gave, using copy /b on Windows. –  Paddy Landau Dec 12 '12 at 17:16

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.