How to use unzip in linux terminal SSH?

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

1 Answer

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.

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

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

You Might Also Like