Delete all files except
rm -rf $(ls * | grep -v “directory or file to save”)
In order to delete all files except multiple files you can do :
rm -rf $(ls * | egrep -v “foo|bar|test|”
rm -rf $(ls * | grep -v “directory or file to save”)
In order to delete all files except multiple files you can do :
rm -rf $(ls * | egrep -v “foo|bar|test|”