统计命令行使用占比

2022/10/2 posted in  Linux comments
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 -n10

PS

来自某位 V2EXer