zip command line utility never creates a
__MACOSX directory, so you can just run a command like this:
In the output below,
a.zip which I created with the
zip command line utility does not contain a
__MACOSX directory, but
a 2.zip which I created from Finder does.
YemuZip is a simple, free utility with a single purpose: to help you easily create Mac- and PC-friendly ZIP files with just a quick drag and drop. The Mac OS already includes ZIP-compression. YemuZip is a free tool that creates ZIP archives. I've been looking for a free alternative to all the programs that offer ZIP compression support and here it is. Creating archives was never easier than with YemuZip. There is the Mac OS X built in ZIP support, but YemuZip provides you more flexibility. The iPack is a full-featured compressed archiving and non-archiving tool designed for MAC. Autodesk Mudbox 3d digital sculpting and texture painting software provides 3D artists with an intuitive toolset for creating highly detailed 3D geometry and textures. YemuZip is an easy to use Mac application that enables you to effortlessly make ZIP archives. Furthermore, YemuZip's intuitive interface helps you select between an OS X ZIP algorithm that will add all Mac specific metadata into the output archive, and an algorithm for creating PC-friendly files.
-x .DS_Store does not exclude
.DS_Store files inside directories but
-x *.DS_Store does.
The top level file of a zip archive with multiple files should usually be a single directory, because if it is not, some unarchiving utilites (like
7z, but not Archive Utility, The Unarchiver,
dtrx) do not create a containing directory for the files when the archive is extracted, which often makes the files difficult to find, and if multiple archives like that are extracted at the same time, it can be difficult to tell which files belong to which archive.
Archive Utility only creates a
__MACOSX directory when you create an archive where at least one file contains metadata such as extended attributes, file flags, or a resource fork. The
__MACOSX directory contains AppleDouble files whose filename starts with
._ that are used to store OS X-specific metadata. The
zip command line utility discards metadata such as extended attributes, file flags, and resource forks, which also means that metadata such as tags is lost, and that aliases stop working, because the information in an alias file is stored in a resource fork.
Normally you can just discard the OS X-specific metadata, but to see what metadata files contain, you can use
xattr also includes resource forks and file flags, because even though they are not actually stored as extended attributes, they can be accessed through the extended attributes interface. Both Archive Utility and the
zip command line utility discard ACLs.
compress a folder mac, On your Mac, do any of the following: Compress a file or folder: Control-click it or tap it using two fingers, then choose Compress from the shortcut menu. If Uncompress (expand) an item: Double-click the .zip file. On your Mac, do any of the following: Compress a file or folder: Control-click it or tap it using two fingers, then choose Compress from the shortcut menu. If Uncompress (expand) an item: Double-click the .zip file.