Do all the things like ++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatarSign Up
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple APILearn More
I usually have the problem under normal circumstances as well. When the search command is like 30 "arrows" away, I'll usually just skim each line for some word and also just enter it the second I spot it.
Just bad when the command was not what I expected...
It's like a bad reflex.
synemeup33454d(Do not) Just run "source .bash_history" to prevent it from happening again. By probably breaking your system. Don't run it.
zvyn92554dAlways be specific when running destructive commands: Never rm *, and put -r at the end. E.g rm subdir/* instead of cd subdir; rm * and rm subdir/folder -r to prevent accedentially hitting enter at rm -r subdir. Doesn't help when dropping tabels, but you can disable autocommit.
LinusCDE302654d@zvyn @vintprox @AtuM
Yeah. Zsh makes it pretty easy to avoid accidentially encountering a "rm" when I just arrow for "sudo nano" or similar.
Luckily I rarely every actually do arrow rm's or things that could contain it (like "sudo"). The MYSQL-Lesson seems luckily still ingrained in me.
YouAllSuck139154dYou could also explicitly name the path you’re deleting hehe