我需要传递哪些标志来模仿“右键单击 -> ”的行为压缩”?

发布于 2024-09-16 17:04:19 字数 145 浏览 7 评论 0原文

我正在编写一个 shell 脚本,需要使用“右键单击 -> 压缩”时从 Mac GUI 设置的相同选项来压缩目录。据我了解,同上是完成这项工作的正确工具,但是除了“-c”之外,我还需要传递哪些标志?我尝试过原始的“-c”和“-c -k”,并且右键单击都给出了不同的结果。

I'm writing a shell script that needs to compress a dir with the same options that are set from the Mac GUI when you do a "right click -> Compress". From what I understand ditto is the right tool for the job, but what flags do I need to pass besides "-c"? I've tried raw "-c" as well as "-c -k" and both give different results from the right click.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

回忆凄美了谁 2024-09-23 17:04:19

根据“男人同上”,

命令:

       ditto -c -k --sequesterRsrc --keepParent src_directory archive.zip

将创建一个 PKZip 存档,类似于 Finder 的压缩功能。

According to "man ditto",

The command:

       ditto -c -k --sequesterRsrc --keepParent src_directory archive.zip

will create a PKZip archive similarly to the Finder's Compress functionality.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文