Created
June 18, 2013 23:32
-
-
Save charles-hollenbeck/5810465 to your computer and use it in GitHub Desktop.
Same as rm -rv * but allows you to exclude files
This file contains 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
#!/bin/sh | |
#A simple script to clean out a directory except for the files you wish to save | |
for file in "$@" | |
do | |
mv -v $file .. | |
done | |
rm -rv * | |
for file in "$@" | |
do | |
mv -v ../$file . | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment