Alternatives to command line unzip?
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.)
$ unzip -d NEW-DIRECTORY ZIP
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?
Solution 1:
The Unarchiver has a beta version of their command line utility available on their downloads page.
Solution 2:
"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.