0

I am creating a zip file of my application tree, minus folders that have temporary files. For now I exclude the folders using -x option and manually created them with unzip. Is there a way with zip to exclude the files but include the folder (i.e. it would be an empty folder in the zip file?)

I am using

zip -r zipfile.zip . -x appsessions/\* workfolder/\*

but of course it excludes the folders and files in them. I would like to keep appsessions/ and workfolder/ in the zip file, but empty.

user603749
  • 1,638
  • 2
  • 24
  • 36

1 Answers1

0

Give a try to this:

find . -type d -print | zip name.zip -@

Also check this answer: https://stackoverflow.com/a/13234936/1135424

nbari
  • 25,603
  • 10
  • 76
  • 131