ditto vs zip

For copying files with all their metadata ditto is the first choice.


In versions of macOS up until 10.4 the zip command did not support resource forks. So in order to zip up folders properly, you were meant to use ditto.

ditto -c -k -X --rsrc some_folder some_folder.zip

Which is what the Finder uses to create archives, too.

Times have changed slightly. The standard zip now does support resource forks and copying resource forks is now the default behavior for ditto. If you want to avoid copying the additional metadata --norsrc is your friend.


  Preserve resource forks and HFS meta-data. ditto will
  store this data in Carbon-compatible ._ AppleDouble
  files on filesystems that do not natively support
  resource forks. As of Mac OS X 10.4,
  --rsrc is default behavior.


  Do not preserve resource forks and HFS meta-data.
  If both --norsrc and --rsrc are passed, whichever
  is passed last will take precedence. Both options
  override DITTONORSRC. Unless explicitly specified,
  --norsrc also implies --noextattr and --noacl to
  match the behavior of Mac OS X 10.4.