zsh history includes a timestamp, with the option to disable it.
Beyond knowing when a command was executed, what's the reason for this? What features might I lose if I disable this?
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It only takes a minute to sign up.Sign up to join this community
zsh history includes a timestamp, if the
EXTENDED_HISTORY feature is enabled, or if the
SHARE_HISTORY feature is enabled; in the latter case, timestamps are used so multiple shells can read each others’ history accurately — they only need to read any new commands added since the last time they read the history file, and they can do so even when the history file is rewritten.
These features are enabled or disabled using
setopt extendedhistory setopt sharehistory
will enable them, while
setopt noextendedhistory setopt nosharehistory
will disable them.
If you want to keep shared histories, you’ll need to keep the extended timestamps (but you don’t need to explicitly enable the
EXTENDED_HISTORY feature; the
SHARE_HISTORY feature is self-sufficient).
Note that extended history tells you not only when a command was executed, but also how long it took to run, which can be useful in some cases.
The History section of the documentation has all the details.