tmux에서 실행 한 명령의 히스토리를 어떻게 볼 수 있습니까? 실행 중이며 bash에 history를

12.04 서버를 실행 중이며 bash에 history를 입력하면 bash에 입력 한 대부분의 명령이 표시되지만 tmux 세션에서 입력 한 명령은 표시되지 않습니다.

세션을 종료 한 후 Ubuntu 12.04 서버의 tmux 세션 내에서 실행 한 명령의 내역을 어떻게 볼 수 있습니까?



답변

여러 bash 쉘에서 bash 히스토리를 보존해야합니다. 이렇게하려면 ~/.bashrc파일에 다음 줄이 있어야 합니다.

# avoid duplicates..
export HISTCONTROL=ignoredups:erasedups

# append history entries..
shopt -s histappend

# After each command, save and reload history
export PROMPT_COMMAND="history -a; history -c; history -r; $PROMPT_COMMAND"

출처 : /unix/1288/preserve-bash-history-in-multiple-terminal-windows


답변