Linux
bash multiple session history
구차니
2021. 10. 1. 21:05
여러창에서 하거나
여러 로그인을 통해서 하다 보면 bash 명령어가 정상적으로 쌓이지 않는다.
아래 변수가 정의 되도록 하면 된다는데.. 터미널 별로 그럼 history가 나오게 하려면 어떻게 하지?
export PROMPT_COMMAND='history -a' |
[링크 : https://askubuntu.com/questions/80371/bash-history-handling-with-multiple-terminals]
+
2022.07.08
별도의 로그파일이 남기기.
export PROMPT_COMMAND='echo -e "$(tty)\t$(history 1)" >> ~/bash-history-$(date "+%Y-%m-%d").log' |
[링크 : https://unix.stackexchange.com/questions/348937/how-to-set-the-history-log-properly]