ZIP files created with GUI have more bytes than ZIP files created in a shell

filezip

I created two ZIP files of the same directory. One with the GUI, the other with:

$ zip -r alpha_cmd.zip Alpha

The Alpha directory is 33.640 MB with 164 items.

The ZIP file created by the GUI is 2,100 bytes larger than the ZIP file created on the command line.

Why is the ZIP file created with the GUI larger?

Note: Even though the ZIP files have different sizes, when unzipped, each's directory has the exact same number of bytes. Basically, I'm very wary of possible inconsistencies introduced by managing my file system with the GUI and with shell commands.

Best Answer

Zipping from the Finder adds a folder __MACOSX, invisible on Macs, that contains OS X resource forks like custom icons and such. From Wikipedia:

The resource fork is a fork or section of a file on the Apple Mac OS operating system used to store structured data along with the unstructured data stored within the data fork. A resource fork stores information in a specific form, containing details such as icon bitmaps, the shapes of windows, definitions of menus and their contents, and application code (machine code). For example, a word processing file might store its text in the data fork, while storing any embedded images in the same file's resource fork. The resource fork is used mostly by executables, but every file is able to have a resource fork.