Linux How to..

Linux How to ,Share Knowledge

TAG : safe-rm 

Protect important file and folder with rm command

cd /root/installed/

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 :


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


Comments are closed.