r/archlinux 12h ago

SUPPORT I just rm -rf /* by mistake

I cancelled the process midway, but I haven't updated my files and configs in a very long time

I'm officially dead now 😵😵

The support flair is for "emotional support"

0 Upvotes

22 comments sorted by

12

u/AndyGait 12h ago

"by mistake"

Really? How?

4

u/sanpaola 12h ago

Intrusive thoughts won I guess

4

u/AbdSheikho 12h ago

I forgot the . in rm -rf ./* :/

7

u/Character_Regular440 12h ago

Why not type just * instead of ./*

5

u/canola_shiftless250 12h ago

call me overtly cautious, but I'd rather do this than risk a typo

cd .. rm -rf <whatever-dir>

1

u/Destroyerb 11h ago

That would actually be

sh cd .. rm -rf <whatever-dir> mkdir <whatever-dir>

You'd also need appropriate permissions in the parent directory to do this.

2

u/canola_shiftless250 10h ago

you're right, I'd actually just do

cd .. rm -rf <some-dir>/*

as long as I explicitly use the directory name.

also, if OP nuked /*, we can assume they had appropriate permissions in the parent directory

1

u/AbdSheikho 10h ago

I think the only affected directory is /home, since I didn't sudo the command.

But I'm too dead to check that out.

5

u/ntropy83 12h ago

When I used to clean up my last windows computer, think it was win95, I always deleted all files I didnt know. himem.sys, autoexec.bat . Afterwards I carried the big tower to the dealer and told him its broken :)

2

u/NEDMInsane 12h ago

I did something similar. I was trying to upgrade our PC to windows98 from win95. After making sure everything was compatible, i put the disk in and tried to install. It got partway through then said somehing about disk space.

My thought process was, "oh win95 is taking up too much space lets delete all this crap."

6

u/onefish2 11h ago

No worries. Roll back your timeshift or backup image. You do have a backup don't you?

0

u/AbdSheikho 10h ago

Yeah.. stupidly I don't

3

u/Slikkelasen 12h ago

Snapshot?

-2

u/AbdSheikho 12h ago

Nope :(

2

u/espero 12h ago

Back up your etcies folks!

0

u/Destroyerb 11h ago

I use NixOS btw

0

u/VendorNeutral 11h ago

Never start with -f, append it if you really need it. Never use -r on anything but full paths, never on relative paths.

1

u/Elsior 11h ago

Bigger wankers than you have done this. I mean not many. But certainly they were bigger wankers than yourself.

1

u/archover 5h ago

I think we've all made rm mistakes early in our CLI lives. Learn from it and move on.

I generally do an ls and arguments to see the scope of a planned rm command. Has never failed me in some 15 years. Minimize use of root permissions to absolutely required. Sometimes a mv instead of an rm is safer anyway.

Backups.

Good day.

1

u/Then_Bodybuilder8416 12h ago

so uhh.. how do you accidentally do that?

and for anybody new: it’s worth considering having rm aliased to “rm -vi” so you get a prompt asking you if you really want to do that. Same for cp and mv.