An open API service indexing awesome lists of open source software.

https://github.com/hypnotics-dev/zsh-frequency

Analyse the frequency of a command used while in ZSH
https://github.com/hypnotics-dev/zsh-frequency

cli terminal zsh

Last synced: about 1 year ago
JSON representation

Analyse the frequency of a command used while in ZSH

Awesome Lists containing this project

README

          

* zsh-frequency

A command line tool to determine the frequency of a command or a variable inside of zsh_histfile.

** Installation

*** Compile from source

To compile from source on linux, you should run this command

#+begin_src sh
cargo install --git https://github.com/hypnotics-dev/zsh-frequency.git
#+end_src

** Utilisation
Currently zsh-frequency only supports 2 commands, top and bot.

*** Top
Returns the top N results, if 2 commands have the same frequency, then the order they are displayed is randomised.

#+begin_src sh
zsh-frequency --file tests/zshhist top 5
#+end_src

The example above returns the top 5 results from the test file zshhist, you can find said file in the tests directory in the repository. If you ran the command, then the output should be, with the order of nv and playerctl being randomised.
#+begin_example
cd:27
ll:24
pactl:17
nv:8
playerctl:8
#+end_example

*** Bot
Returns the bottom N results, if 2 commands have the same frequency, then the order they are displayed is randomised.

#+begin_src sh
zsh-frequency --file tests/zshhist bot 5
#+end_src

The example above returns the bottom 5 results from the test file zshhist, you can find said file in the tests directory in the repository. If you ran the command, then the output would resemble something like this, since there are 9 commands that only appear once, you may only one of these commands in your output. If this is the case, don't worry, this is normal.

#+begin_example
git:1
cargo:1
zrel:1
eval:1
pacman:1
#+end_example