防止rm强制删除
[root@mysql-db01 ~]# grep 'rm' .bashrc # alias rm='rm -i' [root@mysql-db01 ~]# grep 'rm' /etc/profile alias rm='echo Are you sure to remove it ?' [root@mysql-db01 ~]# source .bashrc [root@mysql-db01 ~]# source /etc/profile [root@mysql-db01 ~]# alias rm alias rm='echo Are you sure to remove it ?' 测试删除 [root@mysql-db01 ~]# touch test.sh [root@mysql-db01 ~]# ls -l total 0 -rw-r--r-- 1 root root 0 Jun 11 16:50 test.sh [root@mysql-db01 ~]# rm test.sh Are you sure to remove it ? test.sh [root@mysql-db01 ~]# rm -rf test.sh Are you sure to remove it ? -rf test.sh [root@mysql-db01 ~]# ls -l total 0 -rw-r--r-- 1 root root 0 Jun 11 16:50 test.sh 删除必须加上撬棍符号 "" [root@mysql-db01 ~]# m -rf test.sh [root@mysql-db01 ~]# ls -l total 0 [root@mysql-db01 ~]#