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

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-11-13
  • 2021-12-12
猜你喜欢
  • 2021-12-15
  • 2022-12-23
  • 2021-06-28
  • 2022-12-23
相关资源
相似解决方案