A script that is under the user root directory of Linux. BASHRC finally add the following code, you can modify the RM command, so that people will not be all the RM time to delete, but will be added to the Recycle Bin, the following is based on other people's data reference modified, not original
After joining, you need source. BASHRC
Working principle, redefining RM, each time RM is executed, the file will be MV to the ~/.trash directory
Operation method, under Terminal execution:
Mcls-----"empty. Trash files in the Recycle Bin
ur restores the specified file
Cattrash viewing the contents of the Recycle Bin
Mkdir-p ~/. Trash alias RM=Trash #alias R=Trash alias Cattrash='ls ~/.trash'alias ur=Undelfile alias Mcls=Cleartrash Undelfile () {MV-I ~/.trash/[email protected].} trash () {MV [email protected]~/.trash/} cleartrash () {Read-P"Clear sure? [N]"Confirm [$confirm=='y'] || [$confirm = ='Y'] &&/BIN/RM-RF ~/.trash/* }
Linux under RM Command modification, add Recycle Bin function "notes"