DEV Community

Cover image for Playing with fire: a devastating command line command (rm)

Playing with fire: a devastating command line command (rm)

RealToughCandy.io on August 21, 2019

Let’s talk about the most dangerous, powerful, and perhaps even most exciting command line command of them all: rm. rm is shorthand for ...
Collapse
 
curtisfenner profile image
Curtis Fenner

At the end of a long day, after writing a script to go through some log files, I was finally done and needed to rearrange a bit of mess of files I had made before heading home. That's when I typo'd rm instead of mv, one of those things your fingers type with you realizing it. I was tired, and never felt more embarrassed at work, because one of my coworkers was watching as I did this.

At least writing the script was easier the second time.

Collapse
 
realtoughcandy profile image
RealToughCandy.io

Eeeeek! I'm glad you lived to share the story though! 😁

Collapse
 
craigmc08 profile image
Craig McIlwrath

I have a /dev folder where I just have all my projects in their own folder. I wanted to delete one of them, so I used rm and somehow deleted everything in my /dev folder... luckily I use git for most of my projects. But I still lost a lot and am now much more cautious with rm.