The contents of ~/.zsh_history are not well-formed (e.g. there can be mismatched quotes that were Ctrl-C'd). However, the zsh builtin fc can parse it just fine.
It'd be cool to mimic whatever fc is doing, but here's a way easier thing for this project to do:
fc -lDt '%Y-%m-%d %H:%M:%S' 1 | most-used
That fc command prints out a command number, timestamp, and time taken for each command like so:
The contents of
~/.zsh_history
are not well-formed (e.g. there can be mismatched quotes that were Ctrl-C'd). However, the zsh builtinfc
can parse it just fine.It'd be cool to mimic whatever
fc
is doing, but here's a way easier thing for this project to do:That
fc
command prints out a command number, timestamp, and time taken for each command like so:It's quite well-formed.