我最常用的10条命令

mayflowers posted @ 2008年3月27日 06:40 in Linux with tags Linux Command , 2524 阅读

     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  202  20.2%  ccf
     2  176  17.6%  vi
     3  117  11.7%  cd
     4  104  10.4%  ls
     5  58   5.8%   exit
     6  42   4.2%   bash
     7  32   3.2%   su
     8  31   3.1%   make
     9  20   2%     g77
    10  13   1.3%   gcc

root 结果:

     1  184  18.4%  ls


     2  178  17.8%  cd


     3  85   8.5%   yum
     4  83   8.3%   vi
     5  81   8.1%   exit
     6  30   3%     mount
     7  21   2.1%   SciTE
     8  21   2.1%   make
     9  19   1.9%   rm
    10  18   1.8%   umount

Avatar_small
獨立的圓 说:
2008年3月27日 19:09

  1    151  30.2%  sudo
  2    90   18%    vi


登录 *


loading captcha image...
(输入验证码)
or Ctrl+Enter