Mac Os Zip Command Line

It was Archive Utility’s fault (a Mac OS X unzipper app). When I used the unzip command from the command line, it works great. (cd MyFolder && zip -r -X './MyFolder.zip'.) Solution no. 2: Stumbled across this answer but didnt want to have to change in out of directories. I found the -j option. Command Examples for Windows. The 7-Zip command-line executable file is the 7za.exe. Sweet monkey balls, the problem was Mac OS X (opening the zip from the Finder using Archive Utility. Using unzip in the command line works as expected. Thanks for the sanity check! – Eli Jul 3 '14 at 17:30 show 2 more comments. 3 Answers Active Oldest Votes. It was Archive Utility's fault (a Mac OS X. An A-Z Index of the Apple macOS command line (macOS bash) afconvert Audio File Convert afinfo Audio File Info afplay Audio File Play airport Manage Apple AirPort alias Create an alias. alloc List used and free memory apropos Search the whatis database for strings asr Apple Software Restore atsutil Font registration system utility automator Run an Automator workflow awk Find and Replace text. The zip command line utility never creates a MACOSX directory, so you can just run a command like this: zip directory.zip -x.DSStore -r directory In the output below, a.zip which I created with the zip command line utility does not contain a MACOSX directory, but a 2.zip which I created from Finder does.

Mac Terminal Unzip

Question or issue on macOS:

I can’t find the answer to this for the life of me. Because I am packaging a zip in a specific way for a build process, I don’t want to include a folder at all in the resulting zip at the root. For example, if I have this file path:

And I use either the command:

or

I end up with a zip file that has the root element of MyFolder. What I want is for when I unzip it is to dump all of it right into the directory, like this:

In other words, I don’t want MyFolder or any other folder as the root. I read through the whole manual and have tried numerous options and a lot of Google searching, and zip seems to just really want to have a folder at the root.

Zip

Thanks!

How to solve this problem?

Solution no. 1:

It was Archive Utility’s fault (a Mac OS X unzipper app). When I used the unzip command from the command line, it works great.

Solution no. 2:

Stumbled across this answer but didnt want to have to change in out of directories. I found the -j option useful which adds all files to the root of the zip. Note that its is all files so subdirectory structure will not be preserved.

So with this folder structure:

And this command:

You get this:

Terminal Unzip

Solution no. 3:

I found the easier way to make an encrypted zip file with the terminal app on mac (mac os) just from the files of your folder.

The command for the terminal

That’s it. Enjoy!

*

For more information to zip command in the terminal app

Mac Os Zip Command Line Commands

What -j and -e do?

Zip Directory Command Line

Hope this helps!