You're viewing a single thread.
50 0 ReplyI 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")
35 0 ReplyOr just
!!
for the last command. Particularly helpful if you forgot to prefix it withsudo
you can runsudo !!
19 0 ReplyLearn something new everyday
2 0 Reply
I highly recommend installing fzf, and its shell integration. Makes your Ctrl + r magnitudes more pleasant to use!
8 0 ReplyWhat. Da fuck. This always existed?!
7 0 ReplyIt’s probably from within the last 30 years or so
8 0 ReplyOh good as long as it's only a recent update.
6 0 Reply
Also if you put "sensitive" information in your history by mistake you can use "history -d <line#>" to remove it.
Unfortunately I had to use this command too many times.
6 0 ReplyFish shell does this automatically. It's one of the reasons I love it. You can auto-complete based on your command history.
5 0 ReplyI'm personlly a zsh+oh-my-zsh person which has the same type of auto complete option.
My only regret is that something broke the thefuck plugin on my pc and now swearing at my screen doesn't fix my mistakes.
4 0 Reply
Or control R, start typing a bit, control r again.
4 0 ReplyThis works in Powershell as well, even on Windows...
4 1 ReplyCtrl + r to search previous commands
That's a readline thing by the way, so it doesn't just work in bash but also works with other cli applications that are compiled with readline support, for example
virsh
,psql
,fdisk
, ...1 0 Reply