升级到 ubuntu 16.04 后,bash 历史记录在新登录时被截断为 2000

升级到 ubuntu 16.04 后,bash 历史记录在新登录时被截断为 2000

使用此设置的 Ubuntu 14.04 运行良好。

最近用 ubuntu 16.04 重新安装了我的笔记本电脑,每次创建新终端时,历史记录都会被截断为 2000 行。我同时使用 Tilda 和 XFCE 终端,白天创建/销毁很多终端

 bash --version
 GNU bash, version 4.3.46(1)-release (x86_64-pc-linux-gnu)

这里是相关的环境变量:

BASHOPTS=checkwinsize:cmdhist:complete_fullquote:expand_aliases:extglob:extquote:force_fignore:histappend:interactive_comments:progcomp:promptvars:sourcepath
HISTFILE=/home/andrea/.bash_history
HISTFILESIZE=50000
HISTSIZE=50000
PROMPT_COMMAND='history -a'

这是我的 bashrc 部分(由 ~/.bashrc 获取)

# When the shell exits, append to the history file instead of overwriting it
PROMPT_COMMAND='history -a'
export HISTFILESIZE=50000
export HISTSIZE=50000
#change to default , ignoreboth , no dups and no commands beginning with space
export HISTCONTROL=ignoreboth
set -o vi
shopt -s histappend

已经检查过这些问题:

更新:更改 $HISTFILE 似乎可以解决问题,现在行数正在增加

相关内容