Created
May 21, 2024 21:28
-
-
Save prmichaelsen/5d6cc58255e989fceec31f1195f45775 to your computer and use it in GitHub Desktop.
Send your files to .trash instead of the void
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
rmrf () { | |
trash="$HOME/.trash" | |
mkdir -p $trash | |
if [ -z "$1" ]; then | |
echo "Usage: rmrf <dir>"; | |
return 1 | |
else | |
while [ -n "$1" ] | |
do | |
dir="$PWD/$1" | |
mv $dir $trash | |
shift | |
done | |
fi | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment