bash history date/time stamps

By admin, 8 January, 2013

By default, the bash history does not keep tabs on the time of day that a given command was run. But it is really as simple as defining ONE environment variable: "HISTTIMEFORMAT"

This from "Linux by Example": HISTTIMEFORMAT takes format string of strftime. Check out the strftime manual to choose and construct the timestamp that suit your taste. My favorite is "%F %T ".

export HISTTIMEFORMAT="%F %T "