Zip multiple directories separately

In order to zip simultaneously a number of directories, but keep them separate, the following command will just do the job (in bash):

for i in *; do zip -r $i.zip $i; done

(caution: all directories inside which this command is executed will be zipped, so make a separate directory only to create the zip files)

[source]

Leave a Reply

Your email address will not be published. Required fields are marked *