Command line zip everything within a directory, but do not include any directory as the root
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" .)
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:
MyFolder
- MyFile1
- MySubFolder
- MyFile2
And this command:
zip -rj MyFolder.zip MyFolder
You get this:
MyFolder.zip
- MyFile1
- MyFile2