方法1:
vim ~/.bashrc
添加:
if [[ $- == *i* ]]
then
bind '"\e[A": history-search-backward'
bind '"\e[B": history-search-forward'
fi
最后:
source ~/.bashrc
试一下:
在命令行中 输入mo然后按方向键向上就会自动补全以mo开头的历史命令,比如 mount
方法1:
vim ~/.bashrc
添加:
if [[ $- == *i* ]]
then
bind '"\e[A": history-search-backward'
bind '"\e[B": history-search-forward'
fi
最后:
source ~/.bashrc
试一下:
在命令行中 输入mo然后按方向键向上就会自动补全以mo开头的历史命令,比如 mount