在.bashrc中添加一段
vi ~/.bashrc
if [[ $- == *i* ]]
then
bind '"\e[A": history-search-backward'
bind '"\e[B": history-search-forward'
fi
使生效
source ~/.bashrc
测试
/etc/inputrc
,里面的两项要打开,如图参考: https://blog.csdn.net/Happy_Sunshine_Boy/article/details/104695760
发布者:全栈程序员栈长,转载请注明出处:https://javaforall.cn/100342.html原文链接: