[linux] history 취합하기

2024. 8. 11. 19:37· Co/└ 기초지식

세션에서 수행한 명령어가 종료했을 때 취합되어 보이도록 히스토 리 공유 설정이 필요

 

수정한 파일 : /root/.bash_profile 

추가한 내용 : 

cat .bash_profile
# History 파일 설정
export HISTFILE=~/.bash_history

# 모든 세션에서 history 즉시 읽기 및 저장
shopt -s histappend
export PROMPT_COMMAND="history -a; history -c; history -r; $PROMPT_COMMAND"

# history 사이즈 설정 (선택 사항)
export HISTSIZE=1000
export HISTFILESIZE=2000
728x90

'· Co > └ 기초지식' 카테고리의 다른 글

[linux] 현재 사용 중인 TCP 포트 조회  (0) 2024.08.11