Skip to content

Instantly share code, notes, and snippets.

@yuan3y
Created February 11, 2015 02:05
Show Gist options
  • Save yuan3y/1b683d62c1dab9a99593 to your computer and use it in GitHub Desktop.
Save yuan3y/1b683d62c1dab9a99593 to your computer and use it in GitHub Desktop.
find my most used linux commands in bash shell
history | awk '{if ($2=="sudo") {CMD[$3]++;} else {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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment