File size: 409 Bytes
2d06ac4 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
# Loop through each subdirectory in the directory
for folder in */; do
# Remove the trailing slash from the folder name
folder_name=${folder%/}
# Skip if it's not a directory
if [ ! -d "$folder_name" ]; then
continue
fi
# Remove zip if it already exists
rm -f "$folder_name.zip"
# Zip the folder
zip -r "$folder_name.zip" "$folder_name" -x "*.DS_Store"
done
echo "Zipping completed." |