Linux – Unpacking .z01 .z02 .z03 without .zip on LINUX


I have received several archives and they all have extensions of .z01 .z02 .z03 etc.

There is no .zip file and no .z00 file.

If I transfer these files to my Mac and run them through un-stuffit, it unpacks fine.
But I cannot work out who to do this on my NAS (Linux) via the terminal window
(I actually want to automate the process, so it needs to happen on the linux box)

I have tried zip -FF file.z01 –out
and then unzip but that fails.
I have tried 7z and all other suggested options (that relate to having a .zip file) fail.

Can someone point me in the right direction. Do I need a particular version of zip or 7z ??

Best Answer

Are you sure these are all the archive files? Maybe you're missing a .zip or .z00 file somewhere. Or try running file on the files (using file * in their directory works), they may not be zip files at all.

Could also try using cat to "paste" together all the files in the right order, and write to a file (if they're small) or pipe that straight into zip/unzip:

cat .z01 .z02 .z03 ... | unzip

Should be able to use wildcards for the filenames too, like cat name.z*, and testing the list/order with echo name.z* could help too/first.

But man unzip says it should be able to handle wildcards itself, so just this might work too:

unzip name.z*

Possibly requiring escaping (name.z\*) or quoting the asterisk unzip "name.z*" See man unzip.

If the above don't work, then from the man unzip bug (listed below), you may have to cat all the files into a single file, and then run zip -F or zip -FF, as in:

zip -F foo --out foofix or zip -FF foo --out foofixfix

And then unzipping foofix or foofixfix

Info from man unzip:

Multi-part archives are not yet supported, except in conjunction with zip. (All parts must be concatenated together in order, and then ``zip -F'' (for zip 2.x) or ''zip -FF'' (for zip 3.x) must be performed on the concatenated archive in order to ''fix'' it. Also, zip 3.0 and later can combine multi-part (split) archives into a combined single- file archive using ''zip -s- inarchive -O outarchive''. See the zip 3 manual page for more information.) This will definitely be corrected in the next major release.

And this info from man zip may be useful:

Split archives. zip version 3.0 and later can create split archives. A split archive is a standard zip archive split over multiple files. (Note that split archives are not just archives split in to pieces, as the offsets of entries are now based on the start of each split. Concatenating the pieces together will invalidate these offsets, but unzip can usually deal with it. zip will usually refuse to process such a spliced archive unless the -FF fix option is used to fix the offsets.)


In addition, streamed archives, entries encrypted with standard encryption, or split archives created with the pause option may not be compatible with PKZIP as data descriptors are used and PKZIP at the time of this writing does not support data descriptors (but recent changes in the PKWare published zip standard now include some support for the data descriptor format zip uses).