safe-rm : Protect important file and folder with rm command
May-25-2015 By admin
TAG : safe-rm
Protect important file and folder with rm command
cd /root/installed/
wget http://linux.thaieasydns.com/downloads/safe-rm-0.9.tar.gz
tar -zxvf safe-rm-0.9.tar.gz
cd safe-rm-0.9
cp safe-rm /usr/local/bin/
cd /usr/local/bin/
ln -s safe-rm rm
create file config /etc/safe-rm.conf
vim /etc/safe-rm.conf
input line below :
/root/test/test
:wq!
test delete from list above :
rm -rf /root/test/test
safe-rm: skipping /root/test/test
comment : if protect folder /root/test
config on safe-rm.conf
/root/test !!!! not use /root/test/
if protect all file in /root/test/ use /root/test/* but protect sub file on folder /root/test/xxx/*
rm -rf /root/test/
safe-rm: skipping /root/test/
rm -rf /root/test
safe-rm: skipping /root/test
Success…
Posted in: Linux Server install and setup.