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
- Host: GitHub
- URL: https://github.com/hypnotics-dev/zsh-frequency
- Owner: hypnotics-dev
- License: mit
- Created: 2024-07-21T00:37:23.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2024-12-25T05:51:31.000Z (over 1 year ago)
- Last Synced: 2025-01-16T01:54:06.920Z (over 1 year ago)
- Topics: cli, terminal, zsh
- Language: Rust
- Homepage:
- Size: 30.3 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.org
- License: LICENSE
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