My concluding shipping service was almost adding timestamp to terminal inwards Linux. But isn’t it meliorate to only add together timestamp to history command? This enables you lot to opened upwards your terminal anytime, run history
ascendency in addition to discovery out when you lot ran which command, all without keeping terminal or putty windows opened upwards indefinitely. I estimate it’s helpful inwards around cases. Here’s how to add together timestamp to history ascendency output inwards Linux:
Modify .bashrc file
We ask to educate HISTTIMEFORMAT
surroundings variable. Add the next trouble to your .bashrc
file.
export HISTTIMEFORMAT="%F-%T "
Save the file in addition to open a novel terminal, type inwards history
in addition to voila.
root@kali: # history | tail -5
69 2016-10-11-21:33:48 vi .bashrc
70 2016-10-11-21:34:13 exit
71 2016-10-11-21:34:49 history | tail -5
72 2016-10-11-21:40:47 clear
root@kali: #
Pretty neat. You tin larn farther yesteryear adding it inwards the skel or default in addition to therefore that it affects all novel accounts that are created. You tin role config managers such equally Puppet or Spacewalk or Chef to deploy these piffling snippet in addition to therefore that all machines inwards the managed network has timestamp inwards history. Either way, this is a squeamish handy snippet for whatsoever Linux Administrator to have.