I am wondering if there is any way of easily creating a zip file that contains a bunch of files. However, when I double-click to open this zip file, I do not want it to create a subdirectory with the same name as the zip file, I just want all of the files to be extracted into the directory where the zip files is stored.

Is there a certain flag I can add in terminal to do this, or any program that does this.

Thanks for your help!


Mac OS X does one of two things when double-clicking a zip archive, depending on the contents.

  1. If there is a single file or a single directory in the zip archive, then that file or directory will be extracted into the same directory as the zip archive. The name of the zip archive is irrelevant.
  2. Otherwise there is more than one entry in the zip archive, files and/or directories, in which case a sub-directory in the current directory will be created and the multiple entries in the zip archive will be extracted into that sub-directory. The name of the sub-directory is the base name of the zip archive. E.g. the contents of the multiple entry Archive.zip will be extracted into the directory Archive/. If Archive/ already exists, a derived name will be used, such as Archive 2/.

There does not appear to be a way to change this behavior. Instead of double-clicking, you can use the unzip command in Terminal, which will extract the zip archive contents into the current directory in both of the above cases.

| improve this answer | |
  • That is not true, I have highlighted everything in the directory I wanted to zip, and right-clicked, compress files, and it creates a zip file named Archive.zip, and when I double-click and open the zip, it creates a folder named Archive that contains all of the files. – MZimmerman6 Sep 29 '12 at 20:51
  • You are correct, for some sets of content. My answer has been updated. – Mark Adler Sep 30 '12 at 1:29

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.