2

I'm working in OSX. I have a lot of zip files in a directory called data and I would like to unzip them all:

$ ls data
62.zip
63.zip
64.zip
...

I'm using the following command:

unzip -d data "data/*" 

The problem I'm having is that all the files are unzipping to the same target directory, called 10.002, and being overwritten each time. So I end up with only one unzipped file.

How can I make each file unzip to its own unique directory?

Or even better, have all the files unzip to the same directory, but without being overwritten.

  • use -n option on unzip to never overwrite existing files – Manticore Jan 3 '17 at 15:42
1

You could use something like The Unarchiver (freeware) that has prefs for extraction, to put every archive in a separate folder, if there's any danger they contain files of the same name you don't want overwriting.

Alternatively, Stuffit Expander (freeware) can be set to automatically rename any conflicts.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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