document updated 9 years ago, on Oct 17, 2013

For CYA / audit purposes, it's helpful to record the timestamp of when individual commands are run.

If your terminal is setup to capture logs of all screen activity, putting the timestamp in your prompt is one way to do it.

Another way to do it is to have your shell's history mechanism store timestamp data.




Displaying the time in the prompt takes a little hack. See the "typeset -RZ2" section here or here.

Here's a hack for storing timestamp data in history