I really like this comic. Just in case someone didn’t know in Linux you can:
-Ctrl + r to search previous commands
Or
-type history and precede the command number by an exclamation (!) to repeat the command (I.e. “!13”)
Or just
!!
for the last command. Particularly helpful if you forgot to prefix it withsudo
you can runsudo !!
What. Da fuck. This always existed?!
It’s probably from within the last 30 years or so
Oh good as long as it’s only a recent update.
I highly recommend installing fzf, and its shell integration. Makes your Ctrl + r magnitudes more pleasant to use!
There is an advantage to this approach though: fewer errors. You’re plucking a known working command from a list instead of manually typing a (possibly) broken version of it. Worse yet is when it’s a command where typematic mistakes cause unintended side effects like data loss. So, mashing
up
100 times can be pretty smart, especially if you’re not a great typist.@dejected_warp_core That is true if you assume your history contains only working commands…