Created
June 12, 2021 18:36
-
-
Save cgcardona/81d934f37e6900bc91438d4549e00ad9 to your computer and use it in GitHub Desktop.
Get a list of the top 20 commands and how many times they have been run.
This file contains 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
zsh_stats () { | |
fc -l 1 | awk '{ CMD[$2]++; count++; } END { for (a in CMD) print CMD[a] " " CMD[a]*100/count "% " a }' | grep -v "./" | sort -nr | head -20 | column -c3 -s " " -t | nl | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment