Mac zip compress without __MACOSX folder?

后端 未结 14 1536
有刺的猬
有刺的猬 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:25

    This command did it for me:

    zip -r Target.zip Source -x "*.DS_Store"
    

    Target.zip is the zip file to create. Source is the source file/folder to zip up. And the _x parameter specifies the file/folder to not include. If the above doesn't work for whatever reason, try this instead:

    zip -r Target.zip Source -x "*.DS_Store" -x "__MACOSX"
    

提交回复
热议问题