rm -rf Dangers

Cluster focuses on the risks of accidentally executing destructive 'rm -rf /' or similar commands, which can delete home directories or entire filesystems, with users sharing horror stories, suggesting safer aliases or trash mechanisms, and discussing built-in protections.

➡️ Stable 0.7x DevOps & Infrastructure
2,739
Comments
20
Years Active
5
Top Authors
#3179
Topic ID

Activity Over Time

2007
1
2008
8
2009
31
2010
76
2011
154
2012
49
2013
103
2014
174
2015
168
2016
245
2017
229
2018
104
2019
117
2020
217
2021
234
2022
222
2023
161
2024
168
2025
239
2026
39

Keywords

IT CLAUDE UX CLI LLM youllundothat.tk example.com RANDOM OS reddit.com rm rf command folder delete file cd directory accidentally destructive

Sample Comments

cameronbrown • Aug 17, 2019 • View on HN

Worried about a `sudo rm -rf /` kinda thing?

vondur • Sep 22, 2021 • View on HN

Heck. Have an rm -rf would probably ruin some peoples day on their home directory.

ahoka • Dec 30, 2017 • View on HN

The problem that it takes a $type="; rm -rf /" to ruin your day.

kragen • Sep 1, 2025 • View on HN

I bet you've never accidentally rm -rf'ed your home directory or your email archives either.

brudgers • May 19, 2016 • View on HN

Defaulting to "rm -rf *" makes me imagine what could possibly go wrong.

gruez • Jul 4, 2020 • View on HN

agreed. can't wait until I accidentally rm -rf * because I hit an edge case.

purplezooey • May 12, 2020 • View on HN

Well, that's the last time I'll rm -rf / and not think twice about it.

tyingq • Sep 24, 2017 • View on HN

Sure, but you could also replace "rm -rf /" with "id" or something else non destructive. Somebody is going to copy paste that snippet and have a bad day.

nuclear_eclipse • Jun 16, 2011 • View on HN

Sorry, was thinking of the awful `rm -rf /` variant...

the_duke • Jan 31, 2017 • View on HN

That's kind of like saying the 'rm' command is not well thought out, because many people wouldn't want to delete the whole file system when running 'rm -r /'.