Skip to content

Instantly share code, notes, and snippets.

@benhosmer
Created August 20, 2012 09:23
Show Gist options
  • Save benhosmer/3402631 to your computer and use it in GitHub Desktop.
Save benhosmer/3402631 to your computer and use it in GitHub Desktop.
A shell script to tar and zip all directories.
#!/bin/bash
for dir in */
do dir=`echo $dir | tr -d '/'`
echo $dir
tar czf $dir.tar.gz $dir
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment