作者:E4b9a6, 创建:2022-07-19, 字数:661, 已阅:170, 最后更新:2022-07-19
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
使用输出如下
➜ ~ 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
1 542 14.7443% sudo
2 303 8.24266% ll
3 299 8.13384% cd
4 294 7.99782% adb
5 268 7.29053% vim
6 138 3.75408% bash
7 112 3.04679% yay
8 109 2.96518% ping
9 107 2.91077% cat
10 93 2.52992% scrcpy