修改历史记录条数 vi /etc/profile HOSTNAME=/bin/hostname 2>/dev/null HISTSIZE=3000 if [ “$HISTCONTROL” = “ignorespace” ] ; then export HISTCONTROL=ignoreboth else export HISTCONTROL=ignoredups fi
export PATH USER LOGNAME MAIL HOSTNAME HISTSIZE HISTCONTROL
source !$ //使环境变量生效
根据前缀查找补全历史命令 在用户目录新建名为.inputrc的文件 vi ~/.inputrc #(支持上下键) “\e[A”: history-search-backward “\e[B”: history-search-forward #支持pgup和pgdn键 “\e[5~”: history-search-backward “\e[6~”: history-search-forward 保存后运行: bind -f ~/.inputrc