Apple - Alternatives to command line unzip?

"The Unarchiver" is a great tool, and I highly recommend it, both the GUI and the CLI tools.

That said, my unzip command is

ditto -xk foo.zip target_dir

where 'target_dir' is the directory where I want the files to appear (and it can be '.' if you want them to unzip right there).

Note that 'target_dir' will be created if needed.

Also note that ditto does not mind overwriting files, so use with care.

ditto on Mac OS X is designed to preserve resource forks, etc. so it is my preferred method of unzipping files, especially because it ships with OS X by default.


The Unarchiver has a beta version of their command line utility available on their downloads page.


I saw this extremely helpful answer to a problem I was having unzipping applications on another board from user patashnik:

unzip doesn't handle the embedded resourceforks in ZIP files created by the Finder. If you want to unarchive those files from the CLI, use ditto:

ditto -V -x -k --sequesterRsrc --rsrc FILENAME.ZIP DESTINATIONDIRECTORY

If you want to unpack the archive in the current directory, use . as DESTINATIONDIRECTORY