history는 지금까지 사용한 명령어의 목록을 보여주는 프로그램이다.
(정확하게는 쉘 명령어)
[링크 : http://linux.die.net/man/1/history] bash built-in command
[링크 : http://linux.die.net/man/3/history] library
$HISTFILE에 history 내용이 저장되며
bash일 경우 ~/.bash_history 에 저장된다.
$HISTTIMEFORMAT을 통해 history 명령시 명령을 수행한 시간등을 같이 출력이 가능해진다.
개인사용자가 사용한 명령어를 보는데 있어서(사고 쳤을때 라던가?)
제한적이지만(히스토리 기능을 꺼버릴수도 있으니) 개별 사용자의 history를 추적하는것도 방법이긴 하나..
date 값 까지 출력하지 않으면 큰 의미가 없을 것으로 생각된다.
[링크 : http://stackoverflow.com/questions/8561983/retrieving-command-line-history]
[링크 : http://www.tecmint.com/history-command-examples/]
[링크 : http://www.cyberciti.biz/faq/unix-linux-bash-history-display-date-time/]
+
(정확하게는 쉘 명령어)
[링크 : http://linux.die.net/man/1/history] bash built-in command
[링크 : http://linux.die.net/man/3/history] library
typedef void * histdata_t;
typedef struct _hist_entry {
char *line;
char *timestamp;
histdata_t data;
} HIST_ENTRY;
HIST_ENTRY ** the_history_list;
typedef struct _hist_state {
HIST_ENTRY **entries; /* Pointer to the entries themselves. */
int offset; /* The location pointer within this array. */
int length; /* Number of elements within this array. */
int size; /* Number of slots allocated to this array. */
int flags;
} HISTORY_STATE;$HISTFILE에 history 내용이 저장되며
bash일 경우 ~/.bash_history 에 저장된다.
$HISTTIMEFORMAT을 통해 history 명령시 명령을 수행한 시간등을 같이 출력이 가능해진다.
개인사용자가 사용한 명령어를 보는데 있어서(사고 쳤을때 라던가?)
제한적이지만(히스토리 기능을 꺼버릴수도 있으니) 개별 사용자의 history를 추적하는것도 방법이긴 하나..
date 값 까지 출력하지 않으면 큰 의미가 없을 것으로 생각된다.
[링크 : http://stackoverflow.com/questions/8561983/retrieving-command-line-history]
[링크 : http://www.tecmint.com/history-command-examples/]
[링크 : http://www.cyberciti.biz/faq/unix-linux-bash-history-display-date-time/]
+
2019.02.14
export HISTTIMEFORMAT="%y/%m/%d %T " |
보기 편한(?) "년/월/일 시:분:초" 포맷으로 출력된다.
[링크 : https://askubuntu.com/questions/391082/how-to-see-time-stamps-in-bash-history]
[링크 : http://faq.hostway.co.kr/?mid=Linux_ETC&page=11&document_srl=1415]
'Linux' 카테고리의 다른 글
| bash 파일 상태 관련 if (0) | 2014.09.01 |
|---|---|
| audit (0) | 2014.08.30 |
| dd - disk duplicate (0) | 2014.08.29 |
| /etc/login.defs 로 암호 최소 길이 수정하기 (0) | 2014.08.29 |
| mount - relatime / noatime (0) | 2014.08.28 |