Or ctrl+r and start typing what you’re searching for, and repeat ctrl+r to find the next newest match.
For example, [C-r] ssh [C-r][C-r] will auto fill the 3rd most recent ssh command you’ve run. Try it, your life will be filled with rainbows and unicorns.
There are even better ways built into the shell, but I can never remember any of them. I also never thought of history|grep, I think I might actually remember that one. Thanks!
I did this until my coworker got annoyed enough that they told me to start using
history | grep
lmaooOr ctrl+r and start typing what you’re searching for, and repeat ctrl+r to find the next newest match.
For example,
[C-r] ssh [C-r] [C-r]
will auto fill the 3rd most recent ssh command you’ve run. Try it, your life will be filled with rainbows and unicorns.Wait until they tell you about ctrl+r!
There are even better ways built into the shell, but I can never remember any of them. I also never thought of
history|grep
, I think I might actually remember that one. Thanks!Wow, thank you for this.