macOS 查看终端使用最多的TOP 10命令

Posted by Keystion on 2019-05-21

code by @xqin

1
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 -n 10