天天看点

history | awk

看看你最常用的10条Linux命令是什么

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 


 1  193  19.3%  cd
     2  90   9%     ls
     3  63   6.3%   mysql
     4  53   5.3%   ll
     5  48   4.8%   vi
     6  40   4%     cvs
     7  28   2.8%   vim
     8  28   2.8%   exit
     9  13   1.3%   clear
    10  11   1.1%   tail      

继续阅读