.bash_history 작업 날짜 확인하기(세팅)
/etc/profile 파일에 아래 내용을 추가하여 "날짜/시간" 에 대한 기록을 추가해 준다.
# Add timestamp to .bash_history
HISTTIMEFORMAT="%Y-%m-%d_%d_%H:%M:%S "
export HISTTIMEFORMAT
[root@localhost /]# history
993 2017-05-30_09:40:54 vi /etc/profile
994 2017-05-30_09:40:54 history
995 2017-05-30_09:40:54 exit
996 2017-05-30_09:40:08 ls
997 2017-05-30_09:40:12 hostory
998 2017-05-30_09:40:14 history
999 2017-05-30_09:40:34 vim /etc/profile
1000 2017-05-30_09:40:50 exit
1001 2017-05-30_09:40:56 history
1002 2017-05-30_09:42:58 cd /var
1003 2017-05-30_09:42:59 ls
1004 2017-05-30_09:43:00 cd /
1005 2017-05-30_09:43:01 ls
1006 2017-05-30_09:43:16 find ./ -type d -name 'buffered'
1007 2017-05-30_09:43:25 find ./ -type d -name 'buffere'
1008 2017-05-30_09:43:37 find ./ -type d -name 'cache'
1009 2017-05-30_09:45:19 more /etc/profile
1010 2017-05-30_09:45:41 history
# Add timestamp to .bash_history
HISTTIMEFORMAT="%Y-%m-%d_%d_%H:%M:%S "
export HISTTIMEFORMAT
[root@localhost /]# history
993 2017-05-30_09:40:54 vi /etc/profile
994 2017-05-30_09:40:54 history
995 2017-05-30_09:40:54 exit
996 2017-05-30_09:40:08 ls
997 2017-05-30_09:40:12 hostory
998 2017-05-30_09:40:14 history
999 2017-05-30_09:40:34 vim /etc/profile
1000 2017-05-30_09:40:50 exit
1001 2017-05-30_09:40:56 history
1002 2017-05-30_09:42:58 cd /var
1003 2017-05-30_09:42:59 ls
1004 2017-05-30_09:43:00 cd /
1005 2017-05-30_09:43:01 ls
1006 2017-05-30_09:43:16 find ./ -type d -name 'buffered'
1007 2017-05-30_09:43:25 find ./ -type d -name 'buffere'
1008 2017-05-30_09:43:37 find ./ -type d -name 'cache'
1009 2017-05-30_09:45:19 more /etc/profile
1010 2017-05-30_09:45:41 history
'배워서 남주자 > Linux 명령' 카테고리의 다른 글
[Bonding] 네트워크 bonding (0) | 2018.03.23 |
---|---|
[네크워크 ] 네트워크 명령 (0) | 2018.03.23 |
[SSL 인증서] 사설 SSL 인증서 생성 (0) | 2018.03.23 |
[대용량 Disk 사용] parted GPT (1) | 2018.03.23 |
[접속기록] 접속 성공/실패 기록 확인하기 (0) | 2018.03.23 |