Linux 防 rm -rf 之 safe-rm

安装

# wget https://file.cnxiaobai.com/Linux/Safe-rm/safe-rm-0.13.tar.gz
# tar -zxvf safe-rm-0.13.tar.gz -C /usr/local/
# mv safe-rm-0.13/ safe-rm
# cd safe-rm/
# cp safe-rm /usr/local/bin/rm
# ll !$
# export PATH=/usr/local/bin:/bin:/usr/bin:$PATH >>/etc/profile
# source /etc/profile

使用

  • 配置保护文件
# vim /etc/safe-rm.conf
/
/bin
/boot
/dev
/etc
/home
/initrd
/lib
/lib32
/lib64
/proc
/root
/sbin
/sys
/usr
/usr/bin
/usr/include
/usr/lib
/usr/local
/usr/local/bin
/usr/local/include
/usr/local/sbin
/usr/local/share
/usr/sbin
/usr/share
/usr/src
/var
/etc/safe-rm.conf


标题:Linux 防 rm -rf 之 safe-rm
作者:Mune
地址:https://cnxiaobai.com/articles/2021/04/20/1618933344049.html

    评论
    0 评论
avatar

取消