📜  记住在多个终端中键入的所有命令 - Shell-Bash 代码示例

📅  最后修改于: 2022-03-11 14:50:52.446000             🧑  作者: Mango

代码示例1
# Avoid duplicates
HISTCONTROL=ignoredups:erasedups
# When the shell exits, append to the history file instead of overwriting it
shopt -s histappend

# After each command, append to the history file and reread it
PROMPT_COMMAND="${PROMPT_COMMAND:+$PROMPT_COMMAND$'\n'}history -a; history -c; history -r"