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
-
@AtuM Yeah.
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. -
synemeup3124y(Do not) Just run "source .bash_history" to prevent it from happening again. By probably breaking your system. Don't run it.
-
@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. -
@synemeup That seems pretty horrible to do. Seems as deadly as a "rm -rf /" depending on your user or after how many commands a "sudo" might stop you.
Related Rants
Be vary of entering commands from history (Arrow Up), especially if you did a destructive command not long ago.
Did this in a database for a game. I cleaned the clan tables not long before release. Then a short while after the release I searched for a clan related query and ended up clearing one of the tables again (ofc on autocommit). :|
So had to delete the related tables and notified people they had to claim their clan name yet again really quick.
---
Never had the issue on linux yet, but I'm usually vary when doing a generic destructive command (like "rm -r *"). The problem rarely happens with zsh (you can arrow up based on what you already typed) but I'm often still vary and prefix the command with a space to prevent it showing up in my history.
random
mysql
wk263
arrow keys