Mailing List Archive


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[tlug] Seriously? No undo for rm? No trash bin?



Dave M G writes:

 > Well, I've gone and deleted an entire directory of important stuff with 
 > "rm -r". Entirely by accident. Ironically it happened while I was trying 
 > to back the directory up.

Midnight Commander has an undelete command.  You may have some work to
do to use it (Unix file systems tend to have a *lot* of deleted files
in them), and I don't know how well it works with whole trees.

 > The thing is, I am certain that I have on occasion deleted something 
 > from the command line, and Ubuntu moved it into my trash bin. So 
 > initially, I wasn't to panicked.

function safe_rm () { mv -i $@ ~/.Trash/ ; }

is approximately what you want (it's not very smart about files that
duplicate names already in .Trash).  It's possible that Ubuntu had
some similar feature (but smarter).

 > I do have a back up of my data, but this latest rm command will have 
 > destroyed a few solid days of work.

svn, git, or mercurial is your friend here.



Home | Main Index | Thread Index

Home Page Mailing List Linux and Japan TLUG Members Links