zoukankan      html  css  js  c++  java
  • 查看linux占用内存/CPU最多的进程

    ps –aux

    使用sort排序

    查看占用cpu最多的10个进程

    ps –aux |sort –k 3 –nr|head –n 10

    查看占用cpu最多的10个进程

    ps –aux |sort –k 4 –nr|head –n 10

     

    sort

    -t 设置分隔符

    -k 选定列

    -r 反向,默认从小到大

    -n 以数字形式比较大小

    [root@node0 tmp]# cat test

    1:10

    2:2

    [root@node0 tmp]# cat test |sort -t : -k 1 以:为分隔符,排序第1列,从小到大

    1:10

    2:2

    [root@node0 tmp]# cat test |sort -t : -k 2 以:为分隔符,排序第2列,从小到大,不带-n,10比2小,按字符串比较

    1:10

    2:2

    [root@node0 tmp]# cat test |sort -t : -k 2 –n 以:为分隔符,排序第2列,从小到大,带-n,按数字比较

    2:2

    1:10

    [root@node0 tmp]# cat test |sort -t : -k 2 –nr 以:为分隔符,排序第2列,从大到小,带-n,按数字比较

     

    1:10

    2:2

  • 相关阅读:
    Spring Boot
    Spring Boot
    Spring Boot
    Restful API
    Jenkins
    虚拟化
    SpringBoot入门
    System Workbench for STM32(based on Eclipse)开发环境配置
    装机总结
    这年暑假
  • 原文地址:https://www.cnblogs.com/jeancheng/p/13049573.html
Copyright © 2011-2022 走看看