Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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

1 Answer 1

up vote 4 down vote accepted

This looks like it will help.

http://ubuntuforums.org/showthread.php?t=1060130

for i in * ; do zip -vr "$i.zip" "$i" ; mv "$i.zip" /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.zip" "$i" ; mv "$i.zip" /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

 
discard

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.