Ask Different is a question and answer site for power users of Apple hardware and software. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I've found that the command line unzip tool doesn't gracefully handle some of the files I'm unzipping: it makes a bunch of junk directories, and creates files whose resource forks aren't found. (Perhaps they were created strangely.)


Anyways, using Archive Utility is a start, because I can run the following and it is close (and it doesn't mess up my files):

$ open -a "Archive Utility" ZIP

But this does not allow me to specify a new directory for the contents!! It automatically puts them in the current directory. :P

What are my alternatives?

share|improve this question
up vote 6 down vote accepted

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

share|improve this answer
Working well in my scripting, thank you! – Kevin Cantu Nov 8 '10 at 18:46
+1 for suggesting unar without using it's name. ;) – Slomojo Jan 29 '11 at 9:37

"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 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.

share|improve this answer
Can't get this to work. – ThomasReggi Jan 21 '15 at 20:46

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

share|improve this answer

you can use also:


share|improve this answer

Springy is a very versatile unarchiver. Shareware - and worth it to me.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.