2007/12/01

timestamp bash history entries

Wow; bash3 has a terrific feature; the shell variable HISTTIMEFORMAT will timestamp entries in your history - so you can get a *much* better idea of what happened, especially since it's so easy to have multiple sessions going at the same time, so that commands in the history get somewhat interleaved.

Add
HISTTIMEFORMAT='%Y%m%d-%H%M%S: '

to (for example) your .bash_profile.

And Leopard (MOSX 10.5) has bash3 by default; nice.

No comments: