How to install safe-rm.

UPDATE: Current instructions located HERE.
Please ignore the outdated below.

So, you're worried about accidentally wiping out your entire system or important directory by doing something like rm -rf / or rm -rf *

with safe-rm , it won't allow you to do that, you'll get something like:

$ rm -rf /
Skipping /

Here's how to install:

cd /usr/local/src
# get latest version here:
tar xvfz safe-rm-0.8.tar.gz
cd safe-rm-0.8
# find out your $PATH;
echo $PATH # most systems should include /usr/local/bin, if not then select any other listed
cp /bin/rm /usr/local/bin/rm
mv /bin/rm /bin/rm-01
cp safe-rm /bin/rm
vi /etc/safe-rm.conf

Add this to your safe-rm.conf, or any other directories you don't want accidentally deleted:



NOTE: I wrote this how-to up, because the instructions by the author and other sites are pretty vague.

Tags: Server Linux