190
linuxxx
11d

# Was doing some work on a server today and removing loads of stuff. rm -rf file1 Etc Etc Etc Went into another directory with very important data. Wanted to do ls -la but my fingers went: rm -rf ./ . . *1 milisecond later* 😶 FUCK FUCK FUCK FUCK FUCK FUCK FUCK FUCK FUCK FUCK FUCK FUCK CTRL+C CTRL+C CTRL+C CTRL+C CTRL+C CTRL+C CTRL+C CTRL+C CTRL+C CTRL+C CTRL+C CTRL+C CTRL+C CTRL+C CTRL+C *VIGOROUSLY CHECKS FILES* Everything still there 😅

• 46
I did the same with my home folder a few times. Except I didn't notice the typo until I realized my home folder was empty. Jeeeez...
• 71
Our teacher used to say: "This happens when the fingers are faster than the brain, so always take a step back and think what you're doing"

Yes, he is the closest thing to a system administrator-stereotype you can imagine
• 30
Having rm -rf pause for like 2s when called onto a directory would sometimes save people's days, I guess - phew. 😌
• 16
I've never used rn -rf, so excuse me if I'm saying something stupid.

But wouldn't it make sense to add a confirmation to rm -rf? To prevent accidentally fucking yourself?
• 10
Using rm -rf command i usually pause for a while and double check it before execution.
• 42
@Stuxnet you remove confirmations when you use -f. You explicitly say remove what I specified, I don't give a fuck what it takes, just remove it, don't bother me with it..
• 3
I alias rm to rm -vi for just this reason. If I ever get annoyed with it I just use \rm -fr, but then at least I'm being explicit.

Though that isn't much help on a server 😔
• 8
Once I was shift-deleting some useless files using the GUI, but didn't realise my pr0n directory was also selected.

• 25
alias rm='sleep 20 && rm'

Works for me 😏
• 12
@Stuxnet confirmations are useless if you just learn to pass them automatically
• 12
I once had a porn folder, saved as Old_Data. Was once cleaning my laptop and did rm -rf on it... A few weeks later, I had nothing to wank on!! Then it him me!
• 0
@linuxxx ... how is goes? backup for pussy's? wanna say at least u managed to save it. and ./ especially :D
• 4
@kLue Oh no all our servers are backupped several times a day but restoring can take a little and that was time I didn't have ;)
• 0
@linuxxx c'mon there is price for ADG and it's costs not everyone is willing to pay. also prod change from your tmux? :D c'mon @linuxxx u can do better
• 4
@kLue ADG? And yeah, as a Linux engineer at a hosting company, I kind of have to work with live servers.

As for terminals I use Terminator.
• 0
@linuxxx fair enough, i feel u bro. real world is not that ideal as active data guard (oracle db HA) well, it is how it is ;)
• 3
@nin0x03 zsh (and I assume other shells probably) is cautious enough to ask, "are you sure?" when running rm -rf on a dir containing several files. It sometimes gets annoying, but it's saved me a couple of times. There's a shell opt to bypass this check too however, but I use that sparingly.
• 5
@silverstar 20 secs?? That's like an eternity! 😁
• 1
@verboze yes because I have an eternity to save my files....
Though I never had to stop the command....
• 1
Remind me not to allow you to check my server, don't want you to clear my HDD 😛😂😂😂
• 4
I did the same but with a symbolic link haha, what should be 1ms was taking more than 5 seconds when it stroke me that I was removing the actual 40GB folder ... Well.. At least had all on backup :)
• 2
@silverstar yeah, but then when you're sure, you have to wait 20 seconds. Maybe just a y/n confirmation at the start (if you want/have to use -f)
• 3
Do you know a tool called extundelete?
It saved my ass several times😅
• 2
@git-fuckyou I assume this answers my question about how to undo a rm -rf
• 1
@MrJimmy if you are fast enough yes
If you reboot, you're fucked
• 1
The problem with conformations is that you confirm them faster than you can think, too. Happened to me a couple of times, too.
• 0
Did this in the first two weeks on my work computer... A mac.... Caught it too late tho... Lots of missing files.... Fonts missing on restart ... Just properly fucked
• 0
True horror story
• 0
@Stuxnet the f stands for FORCE. It’s exactly the definition of an argument that bypasses confirmation
• 0
That happened to me once, i was in AWS instance console. and... 😢