0

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.

Tony Z
  • 3
  • 1
  • Could you explain in what way that annoys you the result obtained with "-c -k" is different from right click->Compress? – Pascal Cuoq Aug 28 '10 at 16:20

1 Answers1

1

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.

JWWalker
  • 22,385
  • 6
  • 55
  • 76