linux 删除保护

October 25th 2017 | 技术

将以下代码复制到开机启动文件内添加

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/* 
}

#linux