Created
December 22, 2016 06:37
-
-
Save fseasy/276230f3c1008b8fb4e5843375432de7 to your computer and use it in GitHub Desktop.
将系统的rm命令重命名为move
This file contains hidden or 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
# 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