Joys of Rm

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.

  1. Steve’s avatar

    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 :)

  2. Neil’s avatar

    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).

  3. Phil Wilson’s avatar

    Hurrah! Always good to know I’m not the only one. :)

  4. Gary Fleming’s avatar

    I can’t believe there’s not a law that suggests that as time in unix increases, chances of losing work to rm increases exponentially. I know of no-one who hasn’t had at least a minor rm incident who uses unix systems a lot.

Reply

Your email address will not be published.

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>