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

I want to be able to right click multiple folders inside of a directory in nautilus, and be able to create separate zip archives from those folders in that same directory. If possible it would also be great if it automatically deleted the old folders.

So, if I have 30 folders, I want to select those using control-shift, then go to scripts and run the script, and just have those 30 folders compressed into separate .zip archives, and have the old folders deleted (if possible).

Anyone know how to accomplish this? I am not good with terminal, and am looking for a script solution.

share|improve this question
So 30 folders selected, something magical happens and you have 30 zip files and the folders are gone? – Nate Sep 19 '12 at 14:51
if possible. I at least need to be able to create multiple archives from folders. Nautilus allows you to extract multiple, so it should have a feature to create multiple. – KhaosDvorak Sep 19 '12 at 15:24
up vote 4 down vote accepted

This looks like it will help.

for i in * ; do zip -vr "$" "$i" ; mv "$" /move/zipfiles/here/ ; done

you can change the zip to another compression method, just make sure to change the options to match as well. Also it will do all hence the *. So move the folders you want to compress into one folder and go crazy. if you want to delete the folder after just add:

for i in * ; do zip -vr "$" "$i" ; mv "$" /move/zipfiles/here/ ; rm -r "$i"; done
share|improve this answer
Wow Thanks. That is exactly what I needed! – KhaosDvorak Sep 20 '12 at 0:49

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.