Hacker News new | past | comments | ask | show | jobs | submit login

"rm -rf" is dangerous. A versioning system should allow you to get by without doing dangerous stuff.



Oh yes, it's dangerous, and I rarely use it. It's funny, I just cd'ed into my ~/version/loom and saw a directory "58" sitting there dated 2008-08-17. I'll probably keep that one. Then there's "86.12.before_prune" dated 2009-05-20. I could "rm -rf" that one pretty safely, since my prompt shows my current directory as "~/version/loom". Here goes!

  laptop:~/version/loom$ rm -rf 86.12.before_prune
FEEL the adrenaline rush! ;)


http://code.google.com/p/trash-cli/

I don't know, maybe if you're old-fashioned you won't like the trash metaphor, but I love it. And every so often I just do trash-empty 30 to clean out anything older than a month.


I like the trash metaphor. I haven't formalized it yet, but often I will simply "mv" things to ~/old or ~/tmp and let it rot there for a few months. Thanks for the tip, I'll check it out.


I quite like the way Gmail handles this issue. Stuff just goes stale and drops of the first page of your inbox. But it's still there --- and I now feel that it's barbaric to delete emails.


By the way there's another trick I sometimes use when I really really want to delete a directory but I also really really don't want to make a mistake:

  cd ~/somewhere
  mv the_thing_i_want_to_delete ~/tmp/go_away
  cd ~/tmp
  rm -rf go_away
I'll also use Tab to command-complete the "go_away", and pause slightly before pressing Enter.

Sometimes I'll even just let it sit there in ~/tmp for a few months before clobbering it.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: