Compressing files ala Finder via Command Line

The Finder "Compress" option creates a pkZip archive. Here is how to compress and extract with the command line.

Compress:

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

To extract archive.zip do this.

ditto -x -k folder.zip destination_dir

Source