Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: How can I get history listing to include time info?



Jose Unpingco <unpingco@xxxxxxxxxxxx> writes:
> In csh, typing
>
> history
>
> gives a list of the last few numbered commands along with a start and stop
> time of each command.
>
> In zsh, history gives the last few numbered commands but no time info.
> I couldn't find an option in the manual for turning on time info.
>
> Anybody know how to do this w/out losing some functionality?

In zsh, another command for listing the history is fc -l.  (Fc is a command
that lets you do several things with the history.)  If you add on the flags
-d, -f, -E, or -D, then you get time info.  From the man page:

          Also
          when listing, -d prints timestamps  for  each  command,
          and -f prints full time-date stamps. Adding the -E flag
          causes the dates to be printed as  `dd.mm.yyyy'.   With
          the -D flag, fc prints elapsed times.

Hope this helps.

John Guthrie
guthrie@xxxxxxxxxxxxxx



Messages sorted by: Reverse Date, Date, Thread, Author