Skip to content

Instantly share code, notes, and snippets.

@jostyee
Created March 19, 2013 13:25
Show Gist options
  • Save jostyee/5196073 to your computer and use it in GitHub Desktop.
Save jostyee/5196073 to your computer and use it in GitHub Desktop.
awk统计Linux下最常用的20条命令的shell
history | 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment