']); _gaq.push(['_trackPageview']); (function() { var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true; ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js'; var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s); })();

Linux How to..

Linux How to ,Share Knowledge

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 :


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.