使用命令排名
just
posted @ 2010年9月14日 23:20
in linux
, 1246 阅读
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
来源:http://linux.byexamples.com/archives/332/what-is-your-10-common-linux-commands/
1 328 32.8% ls 2 223 22.3% cd 3 49 4.9% exit 4 42 4.2% tail 5 21 2.1% vi 6 15 1.5% ps 7 14 1.4% tracepath 8 14 1.4% ping 9 13 1.3% vim 10 13 1.3% df