Tuesday 28 March 2017

Add date and time to Linux command history ..



Add Date and time from your linux command history.For this, you can easly find out your command and command run time and date. Which command you have run and what time. 

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

No comments: