Skip to content

Instantly share code, notes, and snippets.

@Vic020
Last active September 18, 2016 08:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Vic020/b96b6ad34cac56a84326f230c43f34ed to your computer and use it in GitHub Desktop.
Save Vic020/b96b6ad34cac56a84326f230c43f34ed to your computer and use it in GitHub Desktop.
oh my zsh statistics history script
zsh_stats () {
fc -l 1 | awk '{CMD[$2]++;count++;}END { for (a in CMD)print CMD[a] " " CMD[a]/count*100 "% " a;}' | grep -v "./" | column -c3 -s " " -t | sort -nr | nl | head -n20
}
@hackrole
Copy link

you start light after learning awk, dog eye now bind.

@Vic020
Copy link
Author

Vic020 commented Sep 18, 2016

@hackrole orz

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment