Skip to content

Instantly share code, notes, and snippets.

@IanVaughan
Created August 16, 2010 11:14
Show Gist options
  • Save IanVaughan/526799 to your computer and use it in GitHub Desktop.
Save IanVaughan/526799 to your computer and use it in GitHub Desktop.
This will tar all the subfolders within the PWD, uncomment the rm at your peril!
#!/bin/bash
# This will tar all the subfolders within the PWD, uncomment the rm at your peril!
DIRS=`ls -d */`
for DIR in ${DIRS}; do
TAR_PATH=${DIR%%/}
echo "Processing : $TAR_PATH"
tar -zcvf ${TAR_PATH}.tar.gz ${TAR_PATH} > ${TAR_PATH}.tar.gz.log
# rm -rf ${TAR_PATH}
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment