How to create a zip file compatible with Windows under Linux
Try with:
zip -9 -y -r -q file.zip folder/
-
-9
Indicates the slowest compression speed (optimal compression, ignores the suffix list) -
-y
Store symbolic links as such in the zip archive, instead of compressing and storing the file referred to by the link -
-r
Travel the directory structure recursively -
-q
Quiet mode
7zip is an open source compression tool that works on Linux, FreeBSD, Mac OS X, BeOS, DOS, Amiga and Windows.
I would highly recommend it based on the windows version.
It supports
packing / unpacking: 7z, ZIP, GZIP, BZIP2 and TAR
Unpacking only: ARJ, CAB, CHM, CPIO, DEB, DMG, HFS, ISO, LZH, LZMA, MSI, NSIS, RAR, RPM, UDF, WIM, XAR and Z.
zip -Z
sets the compression option. -Z store
is the most trivial one, as it doesn't compress at all. This is useful when you're using zip
as an alternative for tar
, or when troubleshooting. In this case you should try to see if an uncompressed archive is usable from Windows. If that is usable, you know that you'll have to pick a non-default compression option.