history统计命令最多的20条

1.1.1 统计使用命令最多的20条

[root@ob1 ~]# history|awk '{ml[$2]++}END{for (i in ml) print i,ml[i]}'|sort -nrk 2|head -20

ps 20

grep 12

man 10

jobs 9

 

[root@ob1 ~]# history|awk '{ml[$2]++}END{for (i in ml) print i,ml[i]}'|sort -nrk 2|head -20|column -t

ps            20

grep          12

man           10

jobs          9

chage         9

 

[root@ob1 ~]# history|awk -F ' ' '{print $2}'|sort|uniq -c|sort -rnk 1|head -20

     20 ps

     12 grep

     10 man

     10 history|awk

[root@ob1 ~]# history|awk -F ' ' '{print $2}'|sort|uniq -c|sort -nrk 1|head -5|column -t

20  ps

15  history|awk

12  grep

10  man

9   jobs

posted @ 2017-09-14 16:13  滴滴滴  阅读(657)  评论(0编辑  收藏  举报