There is both elegance and power in an Operating System that does exactly what you tell it to do when you tell him. However the downside is that if by any chance you do a mistake it can be drastic. Sorry about that.
1: find where rm is located on your system (/bin/rm)
2: cp /bin/rm /bin/remove
3: rm /bin/rm # ;-)
4: mkdir ~/.garbage
5: Make a shell script that moves target file(s) to ~/.garbage
There's your "undo". Just move files back from your .garbage directory. to truly remove files, use "remove". Be aware, that many scripts will use rm and fill your .garbage "bin".
Good luck. Prayer also helps ;-)
Please let Tek-Tips members know if their posts were helpful.
Just to expand on Krale's tip, I did something similar to that a couple years ago on a server that I'm admining (too many users that don't know what they are doing, and too many typo's). Since the backup directories were filling up too fast, and using too much valuable disk space, I extended my scripts to update a small database and keep track of which garbage folders had files added to the recently, and then had a daily script that would simply delete anything that had been in the trash for more than 2 buisness days. I find that gives the users enough time to realize they deleted that report that the absolutly need,but keeps enough disk space that I don't have to keep shuffling data around.
Oh come on, does no one besides farley like my response . You have to admit it's much cooler to actually physically inspect the hard drive to recover files than to impelement an Apple/MS/KDE/GNOME type recycle in. I mean it may not be as reliable, but it's a little more mission impossible isn't it?
Venkman you had a great response and I like it. Sorry I didn't say it earlier, but at the time I was thinking on how to emplement the garbage. It could be a handy trick
Star for venkman
Dave
ToeShot@Hotmail.com
Today Is Tomorrows Yesterday. So Why Wait
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.