这个shell是在linux吧一个小伙伴发的,链接已找不到,挺有意思的,隔段时间运行一次,可以看看自己最近都干了什么。
[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
[/shell]
这是我运行的输出,嘿嘿
1 94 23.5% ls
2 60 15% cd
3 33 8.25% git
4 24 6% echo
5 22 5.5% vim
6 18 4.5% sudo
7 14 3.5% cat
8 11 2.75% test
9 11 2.75% rm
10 9 2.25% mkdir
11 7 1.75% [
12 6 1.5% svn
13 6 1.5% chmod
14 5 1.25% date
15 4 1% sh
16 4 1% gcc
17 4 1% cp
18 3 0.75% uname
19 3 0.75% man
20 3 0.75% ll