用zsh比较方便的一个功能是在找之前用过的命令时可以先输入一部分命令作为过滤条件,
比如,想找 docker run 开头的历史命令,只需要键入 docker run 然后按 进行选择。
但是在用服务器的bash时没有这个功能,每次按 都会把敲入一半的命令清除掉。 ctrl-r 也不是很好用。

解决方法很简单,~/.bashrc中添加两行:

bind '"\e[A": history-search-backward'
bind '"\e[B": history-search-forward'

https://wiki.archlinux.org/index.php/Bash#History_completion

相关文章:

  • 2022-12-23
  • 2021-05-18
  • 2022-02-07
  • 2022-12-23
  • 2021-09-23
  • 2021-12-21
  • 2021-12-18
  • 2021-12-23
猜你喜欢
  • 2022-02-07
  • 2021-09-08
  • 2022-12-23
  • 2022-01-17
  • 2022-12-23
  • 2021-05-30
  • 2021-09-20
相关资源
相似解决方案