【问题标题】:check all the processes which are taking more than 5% of cpu检查所有占用超过 5% cpu 的进程
【发布时间】:2011-02-21 17:34:58
【问题描述】:

如何检查在 HPUX 上占用超过 5% CPU 的所有进程

【问题讨论】:

    标签: unix command-line shell


    【解决方案1】:

    通常的做法是运行toptop -o cpu

    top(1)                                                                  top(1)
    
    NAME
           top - display and update sorted information about processes
    
    SYNOPSIS
           top    [-a | -d | -e | -c <mode>]
                  [-F | -f]
                  [-h]
                  [-i <interval>]
                  [-l <samples>]
                  [-ncols <columns>]
                  [-o <key>] [-O <skey>]
                  [-R | -r]
                  [-S]
                  [-s <delay>]
                  [-n <nprocs>]
                  [-stats <keys>]
                  [-pid <processid>]
                  [-user <username>]
                  [-U <username>]
                  [-u]
    
    DESCRIPTION
           The  top program periodically displays a sorted list of system process-
           es.  The default sorting key is pid, but other keys  can  be  used  in-
           stead.  Various output options are available.
    

    【讨论】:

      【解决方案2】:
      UNIX95=1 ps -eopid,cpu|awk '$2>5{print $1}'
      

      【讨论】:

        猜你喜欢
        • 2018-10-15
        • 1970-01-01
        • 2013-06-13
        • 2012-03-10
        • 1970-01-01
        • 2013-10-22
        • 1970-01-01
        • 1970-01-01
        • 2017-09-12
        相关资源
        最近更新 更多