Skip to content

Instantly share code, notes, and snippets.

@icaoberg
Created August 23, 2012 10:10
Show Gist options
  • Save icaoberg/3435104 to your computer and use it in GitHub Desktop.
Save icaoberg/3435104 to your computer and use it in GitHub Desktop.
Zip all the subfolders of the folders in the current path
#!/bin/bash
for FOLDER in *;
do
if [ -d "$FOLDER" ];
then
echo $FOLDER
for SUBFOLDER in "$FOLDER"/*
do
if [ -d "$SUBFOLDER" ]
then
zip -r "$SUBFOLDER".zip "$SUBFOLDER"
fi
done
fi
clear
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment