Add following line to /etc/bashrc
01. Vim /etc/bashrc
02. export HISTTIMEFORMAT="%h/%d - %H:%M:%S "
03. save and quit
04. logout and login
05. history
995 Sep/06 - 10:46:24 w
996 Sep/06 - 10:46:24 w
997 Sep/06 - 10:46:24 top -c
998 Sep/06 - 10:46:30 date
999 Sep/06 - 10:46:34 history
Tis only works when the bash version in greater than 3. As a example it will not work with RHEL3
ReplyDelete