既存のhistoryから重複を削除
# 現在のhistoryから重複を削除したunduped_historyファイルを作成nl ~/.bash_history | sort-k 2 -k 1,1nr| uniq-f 1 | sort-n | cut-f 2 > unduped_history
# 重複を除去したhistoryを現在のhistoryと入れ替えcp unduped_history ~/.bash_history
# 邪魔なので削除rm unduped_history
今後もhistoryに重複を残さない方法
.bashrcに以下を追記
HISTCONTROL=erasedups
.bashrcを更新
source .bashrc