Creo que HISTTIMEFORMAT es para los proyectiles Bash. Si está utilizando zsh, podría usar estos modificadores para el historycomando:
Ejemplos
$ history -E
1 2.12.2013 14:19 history -E
$ history -i
1 2013-12-02 14:19 history -E
$ history -D
1 0:00 history -E
2 0:00 history -i
Si realiza una man zshoptionso man zshbuiltinspuede obtener más información sobre estos interruptores, así como otra información relacionada con history.
extracto de la página de manual de zshbuiltins
Also when listing,
-d prints timestamps for each command
-f prints full time-date stamps in the US `MM/DD/YY hh:mm' format
-E prints full time-date stamps in the European `dd.mm.yyyy hh:mm' format
-i prints full time-date stamps in ISO8601 `yyyy-mm-dd hh:mm' format
-t fmt prints time and date stamps in the given format; fmt is formatted
with the strftime function with the zsh extensions described for
the %D{string} prompt format in the section EXPANSION OF PROMPT
SEQUENCES in zshmisc(1). The resulting formatted string must be no
more than 256 characters or will not be printed.
-D prints elapsed times; may be combined with one of the options above.
Invocación de depuración
Puede usar los siguientes 2 métodos para depurar zsh cuando lo invoque.
Método 1
$ zsh -xv
Método 2
$ zsh
$ setopt XTRACE VERBOSE
En cualquier caso, debería ver algo como esto cuando se inicia:
$ zsh -xv
#
# /etc/zshenv is sourced on all invocations of the
# shell, unless the -f option is set. It should
# contain commands to set the command search path,
# plus other important environment variables.
# .zshenv should not contain commands that produce
# output or assume the shell is attached to a tty.
#
#
# /etc/zshrc is sourced in interactive shells. It
# should contain commands to set up aliases, functions,
# options, key bindings, etc.
#
## shell functions
...
...
unset -f pathmunge _src_etc_profile_d
+/etc/zshrc:49> unset -f pathmunge _src_etc_profile_d
# Created by newuser for 4.3.10
zsh?zsh --version. Acabo de confirmar en Ubuntu 12.10 que los comandos que te di funcionaron bien.zshbuiltinspágina de manual, descubrí que necesitaba usarfc. Lo que finalmente funcionó para mí fuefc -li. También puede pasar números de comando afc, así quefc -li -100enumera los últimos 100 comandos en su historial.\history -E, uso oh-my-zshhistory -Eohistory -ilo que sea, NO me funciona.zsh --versionmuestra esozsh 4.3.6 (x86_64-suse-linux-gnu).Entonces
fc -li 100funciona! Muestra los 100 comandos recientes con marca de tiempo :)fuente
zsh 5.1.1 (x86_64-ubuntu-linux-gnu). Y mientras estoy aquí: ¿sabes cómo obtener la ayuda del comandofc? Niman fcnifc --helptrabajooh-my-zshel comando de historial, agregue la-lbandera en una de las opciones. ver github.com/robbyrussell/oh-my-zsh/blob/master/lib/…fc -lfmostrará una marca de tiempo completa. Tenga en cuenta que esto solo funciona en zsh, no en bash.run-help fc.Si está usando
oh-my-zshcomplemento enzsh,history -Eohistory -ino funcionará (porque es un alias afc -l 1).Como señaló @juanpastas, intente
\history -Eo
\history -io
fc -li 100fuente