Feb 17, 2009

Adding time to history

I saw a nice hack on shell-fu.org about adding time 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?

1 comment:

Marjan Jeffry said...

It's been a while since I've been using cool shell. Since I've been working with csh I've forgot about history.... :)