When I run the history command on my ubuntu server, I get output as follows:
history
...
25 cd ~
26 ls -a
27 vim /etc/gitconfig
28 vim ~/.gitconfig
I want to view the datetime of a particular user. However when I assume them:
su otheruser
export HISTTIMEFORMAT='%F %T '
history
...
25 cd ~
26 ls -a
27 vim /etc/gitconfig
28 vim ~/.gitconfig
It still doesn't show datetime. I am using zsh shell.
Best Answer
I believe the HISTTIMEFORMAT is for Bash shells. If you're using
zsh
then you could use these switches to thehistory
command:Examples
If you do a
man zshoptions
orman zshbuiltins
you can find out more information about these switches as well as other info related tohistory
.excerpt from zshbuiltins man page
Debugging invocation
You can use the following 2 methods to debug
zsh
when you invoke it.Method #1
Method #2
In either case you should see something like this when it starts up: