Making linux directories `rm -rf` proof

12 views
Skip to first unread message

Dilawar Singh

unread,
Mar 10, 2014, 7:34:47 AM3/10/14
to wncc...@googlegroups.com
The very first to do before using terminal is to add this entry into your ~/.bashrc file

alias rm='rm -i'

So that next time you call rm command to delete a file, it asks you "are you sure?" question. To disable `-i` (interactive), one can use `-f` (force, Do it! I know it all) option. However, once is a while, if you suffer from burnt out neurons after working for a long time, you are sure to remove a directory with -f. In linux, recovering data is "almost" impossible (there is some chance if you immediately unmount the partition). So it is useful to make some directories `rm -rf` proof e.g. /usr, /bin etc.

http://unix.stackexchange.com/questions/77864/making-a-directory-protected-from-rm-rf
Reply all
Reply to author
Forward
0 new messages