#!/bin/bash
cat << EOF
rm abc #删除文件
rl #查看回收站内容
ur abc #回收站找回
EOF
mkdir -p ~/.trash
cat >> .bashrc << EOF
alias rm='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/*
}
EOF
source ~/.bashrc
echo "功能完成"
网友评论