Mac zip compress without __MACOSX folder?

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

    zip -r "$destFileName.zip" "$srcFileName" -x "*/\__MACOSX" -x "*/\.*"
    
    • -x "*/\__MACOSX": ignore __MACOSX as you mention.
    • -x "*/\.*": ignore any hidden file, such as .DS_Store .
    • Quote the variable to avoid file if it's named with SPACE.

    Also, you can build Automator Service to make it easily to use in Finder. Check link below to see detail if you need.

    Github

提交回复
热议问题