Skip to content

Instantly share code, notes, and snippets.

@prmichaelsen
Created May 21, 2024 21:28
Show Gist options
  • Save prmichaelsen/5d6cc58255e989fceec31f1195f45775 to your computer and use it in GitHub Desktop.
Save prmichaelsen/5d6cc58255e989fceec31f1195f45775 to your computer and use it in GitHub Desktop.
Send your files to .trash instead of the void
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