Open a ZIP made on a Mac on Windows or Linux and you will often find a __MACOSX folder, files named ._something and stray .DS_Store files. They are harmless, but they clutter the archive, can trip up upload systems that expect a specific folder layout, and look untidy when you send work to someone else.
What these files are
| File | What it is | Safe to remove? |
|---|---|---|
__MACOSX/ | A folder Finder adds when you use Compress. It holds macOS-only metadata for the files in the archive. | Yes, for almost every use. |
._filename | AppleDouble files, usually inside __MACOSX, one per original file. They carry extended attributes such as Finder tags and download quarantine flags, and resource forks for old Mac files. | Yes, unless the files are legacy Mac files that depend on resource forks, such as some old fonts. |
.DS_Store | Finder's per-folder view settings: icon positions, view mode and sort order. | Yes, always. |
Icon\r, .Spotlight-V100, .Trashes, .fseventsd | Custom folder icons and volume-level system folders, picked up when zipping a whole drive or a folder with a custom icon. | Yes. |
Why macOS adds them
macOS files can carry metadata that ordinary ZIP entries have no place for. When Finder's Compress command builds an archive, it saves that metadata separately as ._ files under __MACOSX/, so that another Mac extracting the archive with Archive Utility can put it back.
On a Mac you never see them: Archive Utility merges them back during extraction, and Finder hides files whose names start with a dot. Everywhere else, they show up as ordinary files and folders.
Remove them from an existing ZIP
- Open Clean ZIP and choose the archive.
- Keep the macOS option on; the Windows option for
Thumbs.dbanddesktop.iniis on by default too. Turn on the others if you also want to drop.gitfolders, editor files or dependency folders such asnode_modules. - Check the preview of what will be removed. You can add your own patterns too, such as
*.log. - Clean and download. Every remaining file is copied byte-for-byte, so nothing else in the archive changes.
To remove individual files by hand instead, use ZIP Editor. On the command line, zip -d deletes matching entries in place, so work on a copy:
cp archive.zip clean.zip
zip -d clean.zip "__MACOSX/*" "*.DS_Store"Create clean ZIPs on a Mac
The __MACOSX folder comes from Finder's Compress command; the Terminal's zip command does not create it. To leave out .DS_Store files as well:
zip -r -X archive.zip folder -x "*.DS_Store"-r includes subfolders, -X leaves out extra file attributes, and -x excludes files matching the pattern. For TAR archives, macOS's tar adds ._ files itself unless you turn that off:
COPYFILE_DISABLE=1 tar -czf archive.tar.gz folderBuilding the archive with Create ZIP in a browser also avoids __MACOSX and ._ files, because browsers do not expose that metadata. A .DS_Store inside a folder you add may still be included; Clean ZIP removes it afterwards.
Skip them when extracting
If you only need to unpack a Mac-made ZIP on Linux, leave the clutter out as you extract:
unzip archive.zip -x "__MACOSX/*" "*.DS_Store"In Extract ZIP, simply leave those entries unticked.