僕のhistoryの設定(Ubuntu & bash)
参考にさせていただきました
$ emacs .bashrc
# historyに記憶するコマンド数
HISTSIZE=5000
# historyなどの履歴を保存しない
HISTIGNORE="fg*:bg*:history*:h*"
# historyに時間を追加
HISTTIMEFORMAT='%Y.%m.%d %T '
# 別タブの履歴を保存する
function share_history {
history -a
history -c
history -r
}
PROMPT_COMMAND='share_history'
# ignorespace 先頭スペースのコマンドは記録しない
# ignoredups 連続したコマンドは記録しない
# ignorespace+ignoredups = ignoreboth
export HISTCONTROL=ignoreboth
有効化
$ source ~/.bashrc