Adding time to history

Tue, 17 Feb. 2009 by Thomas Bendler, approximately 1 min to read.
#unix

I saw a nice hack on shell-fu.org about adding timestamps to your history file:

> export HISTTIMEFORMAT='%F %T '
> history | tail -10
 296  2009-02-17 20:05:45 zpool iostat
 297  2009-02-17 20:05:49 df -h
 298  2009-02-17 20:05:51 w
 299  2009-02-17 20:05:55 last reboot
 300  2009-02-17 20:06:01 uptime
 301  2009-02-17 20:06:09 export HISTTIMEFORMAT='%F %T '
 302  2009-02-17 20:06:15 history | tail -10
>

The only question is, do I really want to know at which time I’m working?


Share on: