Anyone who uses linux or unix-like systems will, at some point, shoot themselves in the foot with rm and *. I, after several years of being careful, just joined the glorious ranks of people who messed up by executing the following in my cygwin home directory:
rm notes *
The space between notes and * was unintentional. Ah the fun.
-
Ah yes, rm. My favourite moment was during my third year project, when I did “rm *java” instead of “rm *class”, though fortunately I had backups of most stuff.
I’ve used recovery tools in the past to reclaim deleted stuff. http://recover.sourceforge.net/ has both info and a recovery tool that should work on ext2 (and therefore ext3) filesystems, though I can’t remember if that’s the tool I used previously.
If you didn’t kill off everything directly after the rm operation, there’s a fair chance that the disk space has been used for something else, rendering any recovery tool useless, but the link might prove useful in future :)
-
D’oh!
I’m so scared of this that I now have the following…
alias rm=”~/bin/saferm”
where saferm is the script
for file in $@ ; domv $file ~/.wastebasket/done
and have a cron job checking that folder nightly and deleting what’s in it. Saves any of the embarassing mistakes and doesn’t waste much disk space (not that that really matters).

4 comments
Comments feed for this article
Trackback link: http://solitude.vkps.co.uk/Archives/2005/10/18/JoysofRm/trackback/