Tuesday, August 16, 2011

How to see history with time in linux

Advertisements

First set the variable HISTTIMEFORMAT as given below.
root@cpaneltest [~]# HISTTIMEFORMAT="%d/%m/%y %T "

Now checking the variable value :
root@cpaneltest [~]# echo $HISTTIMEFORMAT
%d/%m/%y %T

root@cpaneltest [~]#
Now run the command history.
root@cpaneltest [~]# history

   21  16/08/11 00:39:47 for i in $(cat ip) ; do echo $i; done
   22  16/08/11 00:39:47 for i in $(cat ip) ; do ping -t1 $i; done



No comments:

Post a Comment

Be nice. That's all.