How to set up rm -rf recycle bin in linux

  
 

After linux rm deletes the file, recovery is more troublesome. Even if it is restored, the file name format becomes a string of numbers.

Modify the environment variable of the root user
vi ~/.bashrc
Annotation of the 5th line of the comment
#alias rm='rm -i'
Add the following line to the last line< Br>mkdir -p ~/.trash
alias rm=trash
alias r=trash
alias rl='ls ~/.trash'
alias ur=undelfile
undelfile()< Br>{
mv -i ~/.trash/$@ ./
}
trash()
{
mv $@ ~/.trash/
}
Cleartrash()
{
read -p "clear sure?[n]" confirm
[ $confirm == 'y' ]

Copyright © Windows knowledge All Rights Reserved