#!/bin/bash subdir=$(find "./" -maxdepth 1 -type d) for dir in $subdir; do if [ -d "$dir" ]; then zipname="$dir.zip" zip $zipname -r $dir fi done