"리눅스 history 시간 기록하기"의 두 판 사이의 차이

(새 문서: ~/.bash_history(즉 각 계정의 홈폴더의 .bash_history 파일)에는 수행한 명령어들이 기록된다. 여기에 명령어를 수행한 시각을 기록하려면 /etc/pro...)
 
18번째 줄: 18번째 줄:


[[분류: /etc/profile.d]]
[[분류: /etc/profile.d]]
[[분류: Bash]]

2012년 3월 8일 (목) 10:15 판

~/.bash_history(즉 각 계정의 홈폴더의 .bash_history 파일)에는 수행한 명령어들이 기록된다. 여기에 명령어를 수행한 시각을 기록하려면 /etc/profile.d 폴더에 bash_history.sh를 설정해주면 된다.

1 확인

우선 bash_history.sh가 있는지 확인해보자.

[root@localhost ~]# ll /etc/profile.d/bash_history.sh
ls: /etc/profile.d/bash_history.sh: No such file or directory

→ 없다.

2 설정

echo export HISTTIMEFORMAT=\"%F %T \" > /etc/profile.d/bash_history.sh
chmod 755 /etc/profile.d/bash_history.sh
문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}