The command you want is in the buffered history of a still running terminal that’s doing something you don’t want to close 💀
You forgot a couple down arrows for when you overshoot.
CTRL+R
It’s either this or
history | grep 'some-command'
.If you haven’t, try McFly - is a much better backwards / history search in the shell.
Some of you haven’t read the bash manual and it shows.
Blow your mind to know about bang patterns. You’ve used !! but do you know about !$?
history
!982
Ctrl-r was right there.
Or sometimes
history
if I can’t remember at all.Oh my bad, two other people said that too I was just excited
Why would I type out this command that’s six whole keystrokes long when I can save time by pressing ‘up’ twenty times instead?
Introducing:
fish
And then you just need to remember the first letters of the previously typed command
Look up
history-search-backward
in your favorite bash/readline manual.Yup, I started using fish a while back and autocomplete is what kept me on it. The best part is that it’s contextual based on the folder you’re in.