Skip to content

Instantly share code, notes, and snippets.

View sfluor's full-sized avatar
:shipit:

Sami Tabet sfluor

:shipit:
View GitHub Profile
@sfluor
sfluor / zsh_history.py
Created July 22, 2019 18:25
Parse zsh history to see most used commands
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Usage: ./zsh_history.py <path_to_history_file>
import sys
import os
import pprint
from collections import defaultdict
from operator import itemgetter

Units:

  • string-list: list of strings
  • string: one string
  • int: one int over 32bits
  • bool

Strings are not all equal in size but we will make the assumption they are, same for lists

Connection