Skip to content

Instantly share code, notes, and snippets.

@jostyee
Created April 29, 2016 10:01
Show Gist options
  • Save jostyee/bec69014807a1ebe25428122b2e94ff4 to your computer and use it in GitHub Desktop.
Save jostyee/bec69014807a1ebe25428122b2e94ff4 to your computer and use it in GitHub Desktop.
compress all folders in current directory into their own zip files & then delete originals
#!/bin/sh
for d in $(find . -maxdepth 1 -type d)
do
if [ $d != '.' ]; then
echo -ne "$d "
zip -r -m "$d.zip" "$d"
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment