How to remove __MACOSX from zip archives

Creating a ZIP file on your Mac is really easy: select a few files in Finder, right-click on those and select “Compress…”. It’s the equivalent of selecting “Send to ZIP Folder” under Windows.

But Mac OSX does something rather bizarre when creating ZIP files: it adds several unnecessary, unwanted and un-called-for files starting with __MACOSX. This drives PC users nuts – and believe me, it drives Mac users nuts too.

Thankfully there is a relatively easy way to remove those files. This may not always be necessary, but if you require a “clean” ZIP file, here’s what you can do.

First, create your ZIP via the finder – like you always do. Next, open Terminal and cd into the directory where your ZIP file is located. If it’s a long path, just type “cd “, then drag the folder into Terminal (less typing is always good).

Now type the following:

And that should do it. This command (zip) will remove everything (-d) starting with __MACOSX from your ZIP file (your-archive.zip).

To verify, type the following:

This will simply list the contents of your-archive.zip.

Alternatively there is a utility called YemuZip: http://www.yellowmug.com/yemuzip/

Or just use a PC πŸ˜‰

About Jay Versluis

Jay is a medical miracle known as a Super Survivor. He runs two YouTube channels, five websites and several podcast feeds. To see what else he's up to, and to support him on his mission to make the world a better place, check out his Patreon Campaign.

6 thoughts on “How to remove __MACOSX from zip archives

  1. …or you can alternatively download and use free Keka archiver, which contains option to simply “Exclude Mac resource forks”.

    Keka allows you to compress to those formats: 7z, Zip, Tar, Gzip, Bzip2, DMG, ISO
    and it also unpacks all those: RAR, 7z, Lzma, Zip, Tar, Gzip, Bzip2, ISO, EXE, CAB, PAX, ACE (PPC)

    You can set Keka as a default OS X compressor/decompressor and one thing that I miss in OS X compression utility the most – you can set method of compression (store, fast, normal, best/slow), allows you to split archives to volumes and also set up archive passwords. And even more…

    Check it out for sure πŸ™‚

Add your voice!