December 18, 2009

You are currently browsing the daily archive for December 18, 2009.

The other day I wanted to know when I had done something in my shell history, I asked on irc, and dre^ answered -> fc -d for zsh

Now I find myself looking at fc -l -d even when I don’t really need timestamps :-)

% fc -l -d
[snip]
  356  14:56  vim sem.c
  357  18:09  gmake
  358  18:10  vim buffer.c

It is possible to get similar behavior with bash:

$ HISTTIMEFORMAT="%T " history 3
 1386  09:36:54 grep -rl afio .
 1387  09:37:55 vim ChangeLog
 1388  12:56:57 HISTTIMEFORMAT="%T " history 3

Where HISTTIMEFORMAT uses an strftime string.

Yet another useless bit of knowledge!