给ZSH 添加时间戳
Add the following snippet at the bottom of ~/.zshrc file.
Option 1 - Just time
RPROMPT='[%D{%L:%M:%S}] '$RPROMPT
Option 2 - Date and time
RPROMPT="[%D{%f/%m/%y} | %D{%L:%M:%S}]"
When you are done, run $ source ~/.zshrc
to see the effect. If it doesn't work, quit iTerm2 and open it again.
转自:How to add timestamp on right hand side of ZSH / iTerm2 terminal prompt?
Love the neighbor. But don't get caught.