Mac zip compress without __MACOSX folder?

后端 未结 14 1535
有刺的猬
有刺的猬 2020-12-07 06:53

When I compress files with the built in zip compressor in Mac OSX, it results in an extra folder titled \"__MACOSX\" created in the extracted zip.

Can I adjust my se

14条回答
  •  隐瞒了意图╮
    2020-12-07 07:28

    I have a better solution after read all of the existed answers. Everything could done by a workflow in a single right click. NO additional software, NO complicated command line stuffs and NO shell tricks.

    The automator workflow:

    • Input: files or folders from any application.
    • Step 1: Create Archive, the system builtin with default parameters.
    • Step 2: Run Shell command, with input as parameters. Copy command below.

      zip -d "$@" "__MACOSX/*" || true

      zip -d "$@" "*/.DS_Store" || true

    Save it and we are done! Just right click folder or bulk of files and choose workflow from services menu. Archive with no metadata will be created alongside.

提交回复
热议问题