Skip to content

Instantly share code, notes, and snippets.

@charles-hollenbeck
Created June 18, 2013 23:32
Show Gist options
  • Save charles-hollenbeck/5810465 to your computer and use it in GitHub Desktop.
Save charles-hollenbeck/5810465 to your computer and use it in GitHub Desktop.
Same as rm -rv * but allows you to exclude files
#!/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