bash history date/time stamps

© 2022 www.JaxBeachTech.com  |  Ph: 9o4.834.o433  |   email  |  [50.41]

Submitted by admin on Tue, 01/08/2013 - 14:32

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 "