Zipping Multiple Folders Into Separate Zip Files

Here's a bash script that will zip all folders in the current directory into separate .zip files:

for i in */; do zip -r "${i%/}.zip" "$i"; done

I had to do this to 75+ folders today and this definitely saved me some time. It works on macOS too!

Author avatar

About the author

New Hampshirite building web apps in Florida. Creator of Surreal CMS, Postleaf, and DirtyMarkup.

Need to get in touch? Catch me on Twitter.