Mac zip compress without __MACOSX folder?

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

    This is how i avoid the __MACOSX directory when compress files with tar command:

    $ cd dir-you-want-to-archive $ find . | xargs xattr -l # <- list all files with special xattr attributes ... ./conf/clamav: com.apple.quarantine: 0083;5a9018b1;Safari;9DCAFF33-C7F5-4848-9A87-5E061E5E2D55 ./conf/global: com.apple.quarantine: 0083;5a9018b1;Safari;9DCAFF33-C7F5-4848-9A87-5E061E5E2D55 ./conf/web_server: com.apple.quarantine: 0083;5a9018b1;Safari;9DCAFF33-C7F5-4848-9A87-5E061E5E2D55

    Delete the attribute first:

    find . | xargs xattr -d com.apple.quarantine

    Run find . | xargs xattr -l again, make sure no any file has the xattr attribute. then you're good to go:

    tar cjvf file.tar.bz2 dir

提交回复
热议问题