Skip to content

Instantly share code, notes, and snippets.

@suhlig
Created July 14, 2021 08:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save suhlig/cb7917c48099bb0506b105de968f25c0 to your computer and use it in GitHub Desktop.
Save suhlig/cb7917c48099bb0506b105de968f25c0 to your computer and use it in GitHub Desktop.
Useful queries against zsh-histdb
-- start sqlite monitor with _histdb_query
-- most-often used commands; top ones at the bottom
SELECT
commands.argv, count(*) as invocation_count
FROM
history
LEFT JOIN
commands
ON
history.command_id = commands.rowid
LEFT JOIN
places
ON
history.place_id = places.rowid
GROUP BY
commands.argv
ORDER BY
invocation_count ASC
;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment