0

I am trying to zip an individual folder with no compression so I can easily copy the archive to a USB stick without having many thousands of files.

The problem is, the zip command is not doing what I think I'm telling it to do, because I'm apparently not telling it to do the right thing.

What I want is asian.zip to contain the complete folder structure and all the files within. Normally I would simply right-click in Finder and choose Compress, but I'd like to learn how to zip a folder without compressing.

Using the below directory structure (generated using https://linux.die.net/man/1/tree), I've tried:


zip -Z store asian.zip Asian

This results in asian.zip, which is 162 bytes, and contains an empty folder Asian.


zip -Z store asian.zip Asian/*.*

This results in asian.zip, which is 258 bytes, and contains an empty folder Asian/Capsule - 2005 - L.D.K. Lounge Designers Killer. This is the only folder it put in there.


cd Asian/Aural\ Vampire\ -\ 2010\ -\ Zoltank
zip -Z store asian.zip *.*

This results in asian.zip, which is 146.9MB, and contains the folder asian that contains all the mp3 files that were inside the folder I was in.


├── Asian
│   ├── Aural\ Vampire\ -\ 2010\ -\ Zoltank
│   │   ├── 01\ -\ Flare\ Stack.mp3
│   │   ...(each folder listed is full of mp3 like this one)
│   ├── Aural\ Vampire\ -\ 2011\ -\ Kerguelen\ Vortex
│   ├── Capsule\ -\ 2004\ -\ SF\ -\ Sound\ Furniture
│   ├── Capsule\ -\ 2005\ -\ L.D.K.\ Lounge\ Designers\ Killer
│   ├── Capsule\ -\ 2005\ -\ Nexus-2060
│   ├── Capsule\ -\ 2006\ -\ Fruits\ Clipper
│   ├── Capsule\ -\ 2007\ -\ Flash\ Back
│   ├── Capsule\ -\ 2007\ -\ Sugarless\ GiRL
│   ├── Capsule\ -\ 2008\ -\ MORE!\ MORE!\ MORE!
│   ├── Capsule\ -\ 2009\ -\ Flash\ Best
│   ├── Capsule\ -\ 2010\ -\ PLAYER
│   ├── Capsule\ -\ 2012\ -\ Stereo\ Worxxx
│   ├── Capsule\ -\ Misc
│   ├── Faye\ Wong\ -\ Misc
│   ├── Globe\ -\ 1999\ -\ Cruise\ Records\ 1995-2000
│   ├── Globe\ -\ Misc
│   ├── Maximum\ The\ Hormone\ -\ 2004\ -\ Kusoban
│   ├── Maximum\ The\ Hormone\ -\ 2005\ -\ Rokkinpo\ Goroshi
│   ├── Maximum\ The\ Hormone\ -\ 2007\ -\ BuiikiKaesu
│   ├── Maximum\ The\ Hormone\ -\ Misc
│   ├── Maximum\ the\ Hormone\ -\ 2013\ -\ Yoshu�\204\ Fukushu�\204
│   ├── Misc
│   ├── OST\ -\ Chobits\ Original\ Soundtrack\ 001\ -\ 2003
│   ├── OST\ -\ Elfen\ Lied\ -\ 2004
│   ├── OST\ -\ Higurashi\ no\ Naku\ Koro\ ni\ Kai\ Vol\ 1\ -\ 2007
│   ├── OST\ -\ Higurashi\ no\ Naku\ Koro\ ni\ Vol\ 2\ -\ 2006
│   ├── OST\ -\ Noein\ -\ 2006
│   ├── She\ -\ 2006\ -\ Pioneer
│   └── She\ -\ 2008\ -\ Coloris
├── Industrial
├── Misc
├── Rock
├── Rockin
  • Try the -r flag. – Iskar Nov 14 '16 at 22:42
1

You are missing the --recurse-paths option, or -r for short. Use this instead:

zip -rZ store asian.zip Asian

(I'm not on a Mac, but that should apply on both Mac and Linux.)

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.