Re:Review my idea: Preventing accidental usage /bin/rm
by tmhedberg on Thursday June 16, 2011 @05:26PM
(#2663347)
There is libtrash (http://pages.stern.nyu.edu/~marriaga/software/libtrash/), which does something very similar. It adds a library to your LD_PRELOAD variable which intercepts unlink syscalls and moves deleted files to $HOME/Trash instead of actually deleting them. The nice thing about this is that it works transparently, and not just for /bin/rm, but for anything that deletes files.
That's not to say it couldn't be improved upon, though.
That's not to say it couldn't be improved upon, though.