Last active
May 26, 2017 02:35
-
-
Save linuxwizard/4c6607119600bdbf3c8f1819c7fa3417 to your computer and use it in GitHub Desktop.
Bash script to create tar gzip archive
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Simple script to create a tar gzip archive of all directories inside the current directory excluding the shell file and removes the | |
#directory once archived | |
#!/bin/bash | |
#for i in `ls | awk '{print $0}'` | |
for i in `ls | grep -v zip.sh | awk -F. '{ print $1 }'` | |
do | |
tar -czvf $i.tar.gz $i/ | |
echo $? | |
rm -rf $i/ | |
echo $? | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment