Skip to Content
Sindre Sorhus
Back to Actions

Updated

How to Remove .DS_Store and __MACOSX from a Zip File on Mac

By Sindre Sorhus, who makes the Actions app

With Actions

Make a shortcut one time, and then use it from the right-click menu of Finder:

  1. Install Actions, and open it once.
  2. In the Shortcuts app, click the add button to make a new shortcut, and give it a name, like “Clean Zip”.
  3. Click the details button in the sidebar, and select “Use as Quick Action”, with “Finder” selected.
  4. Add the “Clean Zip” action of Actions. Its file field must show “Shortcut Input”. Then add the “Save File” action of Shortcuts.
  5. In Finder, Control-click a zip file, and choose “Quick Actions”, then your shortcut.
  6. Choose where to save the clean zip file.

If the shortcut is not in “Quick Actions”, choose “Quick Actions › Customize…”, and turn it on. Apple’s instructions for quick actions.

The action removes each .DS_Store file and the __MACOSX folder, and keeps all other files as they are. It does not change the original zip file: you get a clean copy.

Get Actions

Additional actions for the Shortcuts app

Download on the App Store

Free

Requires
macOS, iOS, or visionOS 26 or later
Updated
June 2026
US App Store rating
4.8/5 (709 ratings)

More about Actions

Without an app

Terminal has the zip command. To remove the files from a zip file that you already have:

Terminal
zip -d archive.zip "__MACOSX/*" "*.DS_Store"

This changes the zip file itself, so keep a copy if you need the original.

To make a zip file without them, do not use “Compress” in Finder. Go to the folder that contains your folder, and run:

Terminal
zip -r archive.zip folder -x "*.DS_Store"

The zip command does not add a __MACOSX folder, and -x leaves out the .DS_Store files.

Both ways give the same result. Terminal is fast when you know it. The shortcut is easier when you send zip files often, as it is two clicks in Finder.