标签:linux
方式一:自己编写脚本
编写脚本del.sh
#!/bin/bash
TMP_DIR="/tmp/trash_tmp"
mv $@ $TMP_DIR
chmod +x /home/scripts/del.sh
mkdir -p /tmp/trash_tmp
chmod 777 /tmp/trash_tmp
vim .bashrc
alias rm=‘sh /home/scripts/del.sh
source .bashrc
如果需要使用系统默认的rm,只要用\rm即可
方式二:安装trash
执行easy_install trash-cli
安装trash-cli,实现命令行下的回收站。项目见-trash-cli
trash-put trashes files and directories. trash-empty empty the trashcan(s). trash-list list trashed file. trash-restore restore a trashed file. trash-rm remove individual files from trash can.
alias rm=‘echo "This is not the command you are looking for, Please Use "trash"!!!"; false‘
标签:linux
原文地址:http://12085228.blog.51cto.com/12075228/1981239