Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

How do I delete a directory from a zip file using a bash script?

share|improve this question
up vote 9 down vote accepted

From man zip:

      zip -d foo foo/tom/junk foo/harry/\* \*.o

will  remove  the  entry  foo/tom/junk,  all  of  the  files  that  start  with
foo/harry/,  and  all  of  the files that end with .o (in any path).

If that doesn't help, can you provide some details about the commands you've tried and the output?

share|improve this answer

If you want to delete all files from a specific dir, you could do this:

zip --delete "assets/*"
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.