Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
Root797347yThis is what bash functions are for.
Replace rm with a function that lists the pattern and prompts. Never delete something incorrect again. -
GeaRSiX6427yHappens to everyone. I did something like that to the etc/ folder during server migration once...
In my bashrc I've setup rm -rf to do an ls first and wait until I press enter to confirm it. -
Noob64607yOne of the simplest solutions is to "cd .." and then "rm -rf" the specific folder.
The other one is to use full paths and not relative ones.
And, also to ls first and then remove with the same argument. -
@GeaRSiX kinda late to the party but can you hint me where i can get that (alias?) Thing?
-
GeaRSiX6427y@ThatPerlDeb Do some research into the bashrc file. You can do loads of cool stuff with it :)
Related Rants
-
gururaju53*Now that's what I call a Hacker* MOTHER OF ALL AUTOMATIONS This seems a long post. but you will definitely ...
-
linuxxx65This guy at my last internship. A windows fanboy to the fucking max! He was saying how he'd never use anythi...
-
creedasaurus60Another dev on my team just got a new machine. Before he came in today I made two separate USB installers and ...
Lesson learnt :
Never ever do "rm -rf <pattern>" without doing "ls <pattern>" first.
I had to delete all the contents of my current directory.
I did "rm -rf /*" instead of "rm -rf ./*".
rant
linuxxx
linux