Unix Like, 操作系统, 未分类

Bash Shell Script: Security Remove

人有错手,马有失蹄:

rm

可惜rm自带的-i参数效果不太好,要是把-f放在了-i后面,什么提示都没了……

为了防止在各位身上再次出现类似的杯具,特意弄了个叫Security Remove的东西。

Download Link: http://soft.yzs.me/securityremove

此文件的内容很简单,很简单,只有数行。

使用方法,执行以下数行代码即可:

wget http://soft.yzs.me/securityremove -O /bin/securityremove && chmod 755 /bin/securityremove
test -f /etc/bash.bashrc && sed -i "/securityremove/d" /etc/bash.bashrc && echo 'alias rm="/bin/securityremove"' >> /etc/bash.bashrc && . /etc/bash.bashrc
test -f /etc/bashrc && sed -i "/securityremove/d" /etc/bashrc && echo 'alias rm="/bin/securityremove"' >> /etc/bashrc && . /etc/bashrc
test -f /root/.bashrc && sed -i "/alias rm/d" /root/.bashrc && echo 'alias rm="/bin/securityremove"' >> /root/.bashrc && . /root/.bashrc

效果如图所示:

Bash Shell

 

NOTE: 本文的方法仅适用于Login Shell为bash的用户。

102 Posts

自信、努力、活出精彩;以前未所见的颜色,绘大千世界!
View all posts

8 thoughts on “Bash Shell Script: Security Remove”

Leave a reply

Your email address will not be published. Required fields are marked *