1

I just zip a file in my remote server using the command "unzip" in the SSH terminal. It works fine but leaves a new folder called "__MACOSX".

Is there any way to make that the command delete this file after the unzip?

4
  • The only reason that file is there is because it is a normal hidden folder in Mac OSX for all archives created, so its thought to be just a normal folder in the archive.. Jan 30, 2015 at 18:50
  • 1
    unzip file.zip -d destination_folder *Apple provides built-in capability to ZIP files in OS X 10.3 and higher, and these files are the result of Apple storing Resource Forks safe manner. You would never see these files running OS X 10.3 or higher, but since Windows and other operating systems do not understand this special form of Resource Forks they will appear as you see them. Jan 30, 2015 at 19:21
  • 1
    This is related to ubuntu how?
    – Rinzwind
    Jan 30, 2015 at 19:29
  • 1
    @Rinzwind: If you unzip a file that was created on a mac running on Ubuntu , this is what you get...
    – Fabby
    Jan 30, 2015 at 19:35

1 Answer 1

5

This is an extra folder that OSX computers make, they are hidden on OSX.

To exclude the folder from the extraction do:

unzip ZipName.zip -x __MACOSX/*

Replace "ZipName" with the name of your zip. The important part is matching the folder which is made up of two underscores then MACOSX, /* so it doesn’t extract the hidden file in that folder as well as the folder.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .