Last active
April 9, 2016 14:56
-
-
Save atika/7afea75a11f5530369c8 to your computer and use it in GitHub Desktop.
Statistics of shell aliases usage and optional search for a specific command (change to .bash_history for Bash Shell)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
alias_stats() { | |
local search="$1" | |
list=""; for c in $(alias | grep "$search" | cut -d'=' -f1); do count=$(grep -Ec ";$c" ~/.zsh_history); list="${list}\n${count} ${c}"; done; echo -e $list | sort -n | grep -Ev "^0" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment