Unable to forward search Bash history similarly as with CTRL-r

前端 未结 5 583
死守一世寂寞
死守一世寂寞 2020-11-30 15:55

I am trying to search my bash history similarly as with CTRL-r, but to forward direction.

It has been a pain for me, when I just hit once too o

5条回答
  •  孤城傲影
    2020-11-30 16:43

    The best trick IMHO is enabling with pgup and pgdown. just put that in your ~/.inputrc

    "\e[5~": history-search-forward
    "\e[6~": history-search-backward
    

    logout/login, type the first letters and then pgup or pgdown to search throughout history

    ctrl-R search all lines containing words, whereas history-search-forward search lines beginning with words

提交回复
热议问题