Skip to content

Instantly share code, notes, and snippets.

@fseasy
Created December 22, 2016 06:37
Show Gist options
  • Save fseasy/276230f3c1008b8fb4e5843375432de7 to your computer and use it in GitHub Desktop.
Save fseasy/276230f3c1008b8fb4e5843375432de7 to your computer and use it in GitHub Desktop.
将系统的rm命令重命名为move
# change `rm` to `move`
mkdir -p ~/.trash
alias rm=trash
alias r=trash
alias rl='ls ~/.trash'
alias ur=undelfile
undelfile()
{
mv -i ~/.trash/\$@ ./
}
trash()
{
mv $@ ~/.trash/
}
cleartrash()
{
read -p "clear sure?[n]" confirm
[ $confirm == 'y' ] || [ $confirm == 'Y' ] && /bin/rm -rf ~/.trash/*
}
# keep the sys rm func
alias rmsys=/bin/rm
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment