I need to split a .zip file in Ubuntu as .z01, .z02 etc... so that I would join them back in Windows.
I don't have access to command prompt in Windows. How would I unzip files now?
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. Is there replacement for cat on Windows may help, but note that the Windows
type command will not work as it adds the files names between them when processing more than one file. One working approach is
copy /b ZIPCHUNKS* > reassembled-zip.zip.
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.
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!
If you have zip installed on your Ubuntu machine, you should also have zipsplit. This takes a large zip file and splits it into a number of smaller, stand-alone zip files. It doesn't rely on any particular version of WinZip or Rar to work, as the files it makes are plain Zip files.
One caveat: zipsplit still lives in the world of CP/M / MS-DOS 8.3 file names, so if you use it on biglongfilename.zip, you'll end up with biglon_1.zip, biglon_2.zip, biglon_3.zip, etc.
I would use 7Zip. It is available for Ubuntu and Windows (download link here). A GUI is available for either operating system, but you can just as easily use a CLI. There is a textbox (in the GUI) where you put the size of each split zip file. You can use K (kilobyte), M (megabyte), or G (gigabyte) for sizes that are not included in the dropdown menus.
7Zip split volumes:
Through the CLI, you can use the
-v switch to determine the volume size.
In order to reassemble the files, decompress the first file (i.e.