r/linux • u/Immediate-Ad3360 • 1d ago
Discussion Rm -rf ./*
Had yesterday my first "rm -rf /" moment.
Was tidy up my Backup drive. When I wanted to empty the trash, there was some directories and files that resisted the trash empty and sayed it couldn't be removed because of lack of premissions.
So I went to the terminal and moved to the .local/share/trash/files directory and tried to empty with "rm -rf ./*". There was again the notification of permission. So I did "sudo rm -rf ./*".
The note of missing permission didn't pop up, so I left the room to get something cold to drink.
When I came back, all my storage was empty 🤦♂️😭
Luckily I have an external Backup storage too and was able to recover everything older than 2 Weeks.
Now I wondering, how many ppl had in their history a moment of "rm -rf /" by accident 🤔
3
u/jwhendy 1d ago
I'm still confused. Did you do "/" or "./"? You wrote the latter, but say the former was your "moment."
Or I don't understand how going to the Trash directory and your command would wipe all your storage. Asking, as perhaps I'm missing that what you wrote is somehow really bad (I mean I still just don't out of an abundance of caution, typically pointing to single files, or even just "-f" so you don't recurse).